fix(resolution): resolve this.<field>.<method>() on the field's declared type (#1496) - #1792
Merged
Merged
Conversation
…ed type (#1496) Land the six-file fix from upstream PR #1691 by danusha2345 (pr-1691 at 6d0e80d), preserving wasm/native extraction parity and exclusive field-type resolution. Preserve coexistence with the #1566 Map/collection fix merged in #1790, including nested holder.values.get coverage and the unchanged #1566 Unreleased changelog bullet. EXTRACTION_VERSION remains unchanged. Align the existing chained-receiver regression with the fix: a declared service field calls its method, while an anonymous field type does not bind to unrelated same-named project functions. Verified on Linux with Node 22.19.0: - Rebuilt the native kernel and TypeScript/browser distribution. - Both backends change Outbox::send -> Outbox::send into Outbox::send -> Mailer::send, keep Relay::forward -> Mailer::send, and store no self-edges in the issue repro. - Wasm: 224 tests passed; native kernel: 255 tests passed, no skips. - All 10 #1566 resolution cases pass on each backend, plus all four nested-receiver extraction parity cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1496.
Summary
danusha2345) onto currentmain(already includes TypeScript: built-in Map.get/set/has calls resolve to unrelated project methods #1566 via fix: prevent built-in Map calls from resolving to project methods (#1566) #1790).this.<field>on member calls; resolution reads the field declared type and validates the method there (or leaves unresolved for builtins/external types).__tests__/ts-chained-receiver.test.tsso an anonymous field type no longer expects a bare same-name project guess.Linux verify (fail → pass)
Issue fixtures
/tmp/cg-1496-repro(mailer / outbox / relay):CODEGRAPH_KERNEL=0)Outbox::send → Outbox::sendOutbox::send → Mailer::sendOutbox::send → Outbox::sendOutbox::send → Mailer::sendBoth keep
Relay::forward → Mailer::send; zero self-edges after the fix. Resolved byinstance-methodwithrefNamethis.mailer.send.#1566 coexistence
All 10 #1566 resolution cases pass on wasm and kernel; nested-receiver parity cases for
holder.values.getremain green. Both Unreleased changelog bullets retained.Tests
ts-this-field-call,kernel-tsjs-parity,resolution(TypeScript: built-in Map.get/set/has calls resolve to unrelated project methods #1566),ts-chained-receiver, related suites: 224 wasm / 255 kernel passed.Re-index after upgrading.
Agency: prefer land #1691 over reinventing; this PR supersedes #1691 when merged.