GitNexus/gitnexus/test/unit/scope-resolution
Kuntal Rathod 286e08bf49
fix(typescript): resolve calls on non-null and parenthesized receivers (#4234)
* fix(typescript): resolve calls on non-null and parenthesized receivers

A call like `user!.save()` or `(repo).save()` got no CALLS edge. The
receiver capture kept the wrapper in its text (`user!`), so the
receiver lookup found no binding by that name, and the chain synthesizer
mints nothing for a wrapper with no chain steps.

Hand the resolver the unwrapped operand's text instead.

* test(typescript): add the nested receiver fixture for #4233

* fix(typescript): resolve nested transparent receivers without widening postfix scans

Refactor isTransparentReceiverWrapper to include depth parameter and update unwrapTransparentReceiver to handle depth correctly.

* Add C# test case for postfix operator checks

* Add tests for capturing receiver in run() calls

Added tests to capture the name and range of the receiver in various expressions.

* test(typescript): verify each receiver calls only its declaring class

Refactored tests to use parameterized cases for various save method resolutions.

---------

Co-authored-by: Abhigyan Patwari <126312502+abhigyanpatwari@users.noreply.github.com>
2026-11-29 19:30:02 +00:00
..
c fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
cpp refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
csharp fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
go refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
javascript feat(ingestion): add tRPC procedure detection and MCP chain/route surfacing (#3339) 2026-09-21 09:44:42 +01:00
objective-c feat(indexing): add Objective-C semantic indexing support (#3179) 2026-09-09 09:40:21 +00:00
php perf(ingestion): remove unused worker records and repeated AST walks (#3920) 2026-11-14 15:18:27 +00:00
python perf(python): remove quadratic import-claim reconciliation and deep-syntax hazards (#3964) 2026-11-18 15:04:43 +00:00
r feat(r): add R language support (#3513) 2026-11-19 17:16:27 +00:00
ruby fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
rust fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
swift fix(swift): avoid false calls for injected closure properties (#3434) 2026-10-02 23:31:14 +01:00
typescript fix(typescript): resolve calls on non-null and parenthesized receivers (#4234) 2026-11-29 19:30:02 +00:00
vue perf(vue): index template imports once per resolver pass (#4268) 2026-11-29 18:16:13 +00:00
answered-receiver-drops.test.ts fix(resolution): correct receiver drops and property ownership (#3653) 2026-10-22 05:59:59 +01:00
await-route-declines.test.ts fix(dart): resolve the owner of an awaited call result; infer a call-result local only when its name has a single binder (DART-04) (#3876) 2026-11-12 19:36:39 +00:00
awaited-call-result-follow.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
c3-linearize-strategy.test.ts fix(python): resolve mixin calls with CPython C3 order (#3393) 2026-09-28 08:55:13 +00:00
callable-flow-captures.test.ts fix(impact): fail closed on id-less targets and follow ??/||/?: callable values (#3354) (#3373) 2026-09-25 21:43:24 +01:00
callable-flow-depth-cost.test.ts perf(python): remove quadratic import-claim reconciliation and deep-syntax hazards (#3964) 2026-11-18 15:04:43 +00:00
callable-flow-stack-depth.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
callable-value-flow-env.test.ts feat: make MAX_CALLABLE_VALUE_TARGETS configurable via env (#2725) 2026-08-01 12:42:36 +01:00
callable-value-flow-worklist.test.ts perf(scope-resolution): index callable formal owners by position (#4215) 2026-11-28 13:02:13 +00:00
callable-value-target-index.test.ts fix(java): resolve overloads by JLS phases (#3791) 2026-11-01 11:08:00 +00:00
capture-traversal-cost.test.ts fix(java): match javac resolution and move fixtures into conformance (#4056) 2026-11-25 18:03:32 +00:00
cobol-import-target-parity.test.ts fix(cobol): prefer copybook dirs so COPY EXTERNAL does not hit vendor decoys (#3240) 2026-09-10 15:42:59 +01:00
construction-syntax-wiring.test.ts fix(test): align fixtures and mocks with current types (#3471) 2026-10-05 04:47:37 +01:00
dart-capture-scaling.test.ts perf(python): remove quadratic import-claim reconciliation and deep-syntax hazards (#3964) 2026-11-18 15:04:43 +00:00
dart-enclosing-type-cost.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
dart-lexical-names.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
dart-library-exports-scaling.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
dart-package-language-version.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
def-index.test.ts feat(shared): DefIndex / ModuleScopeIndex / QualifiedNameIndex (#913, RFC #909 Ring 2 SHARED) (#958) 2026-04-18 15:59:34 +01:00
definition-id.test.ts fix(scope-resolution): parse def coordinates after file paths (#2743) 2026-07-30 07:34:32 +01:00
emit-references.test.ts perf(java): store an on-demand import once per statement and per package (#3934) 2026-11-14 15:18:27 +00:00
esm-export-marker.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
external-import-conformance.test.ts feat(r): add R language support (#3513) 2026-11-19 17:16:27 +00:00
finalize-algorithm.test.ts fix(ingestion): bind TS/JS default imports to their default export (#3960) 2026-11-16 16:48:35 +00:00
finalize-binding-scaling.test.ts fix(java): preserve receiver and generated dependency ownership (#3955) 2026-11-18 19:48:30 +00:00
finalize-import-groups.test.ts perf(java): store an on-demand import once per statement and per package (#3934) 2026-11-14 15:18:27 +00:00
finalize-orchestrator.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
free-call-fallback-bare-construction.test.ts fix(python): link src-layout imports, class calls and literal __all__ (#3961) 2026-11-16 16:40:11 +00:00
free-call-fallback-guess-taint.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
free-call-qualified-over-name-claim.test.ts feat(r): add R language support (#3513) 2026-11-19 17:16:27 +00:00
function-local-import-chain.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
generic-instantiation.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
graph-bridge-label-split.test.ts fix: type an inference-typed class field so it can act as a call receiver (#2807) (#2810) 2026-08-04 19:31:25 +01:00
heap-pressure-spill.test.ts fix(ingestion): spill lexical scopes under heap pressure for all PDG languages (#4028) 2026-11-22 11:23:21 +00:00
heritage-type-arguments.test.ts fix(java): match javac resolution and move fixtures into conformance (#4056) 2026-11-25 18:03:32 +00:00
import-emission-memory.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
import-scope-provenance.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
import-target-index-parity.test.ts refactor(ingestion): colocate import resolution rules (#3670) 2026-10-22 03:49:35 +00:00
import-target-index-reuse.contract.test.ts feat(r): add R language support (#3513) 2026-11-19 17:16:27 +00:00
import-visibility-grouped.test.ts perf(java): store an on-demand import once per statement and per package (#3934) 2026-11-14 15:18:27 +00:00
import-visibility.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
imported-return-types.test.ts fix(java): match javac resolution and move fixtures into conformance (#4056) 2026-11-25 18:03:32 +00:00
imports-to-edges-deferred.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
imports-to-edges-on-demand.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
imports-to-edges-type-only.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
lexical-name-claims.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
method-dispatch-index.test.ts chore(shared): apply Ring 2 SHARED review follow-ups in one diff (#964) 2026-04-18 18:40:29 +01:00
module-scope-index.test.ts feat(shared): DefIndex / ModuleScopeIndex / QualifiedNameIndex (#913, RFC #909 Ring 2 SHARED) (#958) 2026-04-18 15:59:34 +01:00
name-fallback-summary.test.ts fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
name-fallback-visibility.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
name-lookup-scaling.test.ts perf(indexing): avoid repeated lookups during call resolution (#4013) 2026-11-20 05:23:01 +00:00
namespace-channel-lookup.test.ts fix(csharp): eliminate global-namespace typeBindings O(files²) OOM (#1871) (#1954) 2026-05-31 18:21:07 +01:00
namespace-member-visibility.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
namespace-target-cache.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
namespace-targets-import-path.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
node-lookup-determinism.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
overload-narrowing.test.ts fix(swift,dart): type chained receivers through hoisted return types (#3498) (#3666) 2026-10-22 22:52:11 +00:00
parse-worker-scope-integration.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
php-import-target-parity.test.ts refactor(ingestion): colocate import resolution rules (#3670) 2026-10-22 03:49:35 +00:00
pick-implicit-this-overload.test.ts fix(swift): resolve inherited protocol extension calls (#3309) 2026-09-19 07:44:35 +01:00
pick-unique-global-callable.test.ts perf(ingestion): Linux-kernel-scale analysis — worker-pool parse + finalize O(n²) + scope-resolution memory wall (#1983) (#2038) 2026-06-06 22:46:34 +01:00
pick-unique-global-class.test.ts feat(swift): migrate Swift to scope-based registry resolution (#937) (#1948) 2026-05-31 16:56:47 +01:00
position-index.test.ts fix(scope): preserve lexical bindings in HTTP wrapper detection (#3632) 2026-10-20 11:36:06 +01:00
property-dispatch-fanout-env.test.ts feat: make MAX_PROPERTY_DISPATCH_FANOUT configurable via env (#2726) 2026-08-01 12:18:07 +01:00
property-name-index.test.ts fix(test): align fixtures and mocks with current types (#3471) 2026-10-05 04:47:37 +01:00
provider-call-outcome.test.ts perf(ingestion): remove unused worker records and repeated AST walks (#3920) 2026-11-14 15:18:27 +00:00
qualified-name-index.test.ts chore(shared): apply Ring 2 SHARED review follow-ups in one diff (#964) 2026-04-18 18:40:29 +01:00
receiver-chain-fold.test.ts perf(indexing): avoid repeated lookups during call resolution (#4013) 2026-11-20 05:23:01 +00:00
receiver-chain-wiring.test.ts feat(resolution): type receiver chains from AST structure across all 14 languages (#2708) + epistemic lower-bound (#2744) (#2747) 2026-07-31 07:12:57 +01:00
receiver-site-eligibility.test.ts perf(indexing): avoid repeated lookups during call resolution (#4013) 2026-11-20 05:23:01 +00:00
reconcile-ownership.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
references-to-edges-call-form.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
registries.test.ts fix(python): find dependents of constants and passed functions (#3957) 2026-11-16 16:42:30 +00:00
resolve-ambiguous-inheritance-base.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
resolve-references.test.ts perf(ingestion): remove unused worker records and repeated AST walks (#3920) 2026-11-14 15:18:27 +00:00
resolve-same-namespace-inheritance-base.test.ts fix(scope): bind same-package inheritance bases when the simple name is reused elsewhere (#3659) 2026-10-22 12:45:11 +00:00
resolve-type-ref.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
resolved-callee-names.test.ts fix(test): align fixtures and mocks with current types (#3471) 2026-10-05 04:47:37 +01:00
run-progress.test.ts fix(rename): extend safe refactoring and flow coverage across languages (#3557) 2026-10-13 08:38:17 +03:00
rust-cargo-targets.test.ts fix(scope): resolve local imports by lexical ownership (#3532) 2026-10-10 08:13:55 +03:00
scope-extractor.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
scope-id.test.ts feat(shared): ScopeTree + PositionIndex + makeScopeId (#912, RFC #909 Ring 2 SHARED) (#961) 2026-04-18 16:41:38 +01:00
scope-source-content-policy.test.ts fix(ingestion): close resolver, import and benchmark review gaps (#3945) 2026-11-15 17:06:51 +00:00
scope-tree.test.ts fix(scope-resolution): allow same-range Module-as-parent for top-level scopes (closes #1086) (#1087) 2026-04-27 11:06:54 +01:00
selected-call-propagation.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
simple-receiver-owner.test.ts perf(indexing): avoid repeated lookups during call resolution (#4013) 2026-11-20 05:23:01 +00:00
strip-cast-wrappers.test.ts fix: Java cast-wrapped and this.method() call edges (#2357) 2026-07-02 17:19:33 +01:00
swift-extension-owners.test.ts fix(swift): resolve inherited protocol extension calls (#3309) 2026-09-19 07:44:35 +01:00
swift-target-grouping.test.ts fix(swift): model Swift modules like the compiler (nested packages, Xcode targets, linear visibility) (#3387) 2026-09-27 06:24:35 +01:00
type-parameters.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
type-value-namespaces.test.ts fix(typescript): compare static resolution with the TypeScript compiler (#4084) 2026-11-28 08:10:54 +00:00
undecided-satisfaction.test.ts fix(go): resolve out-of-repo package qualifiers, and stop reporting an undecided interface check as a decided negative (#2873) (#2921) 2026-08-11 10:36:59 +01:00
unresolved-overloads.test.ts fix(java): resolve overloads by JLS phases (#3791) 2026-11-01 11:08:00 +00:00
unresolved-receiver-files.test.ts fix(go): scope and define each type_spec, not the type_declaration (#2837) (#2843) 2026-08-06 00:55:48 +01:00
unresolved-receivers.test.ts fix(java): match javac resolution and move fixtures into conformance (#4056) 2026-11-25 18:03:32 +00:00
untyped-receiver-binder.test.ts perf(ingestion): remove unused worker records and repeated AST walks (#3920) 2026-11-14 15:18:27 +00:00
validate-bindings-immutability.test.ts fix(csharp): eliminate global-namespace typeBindings O(files²) OOM (#1871) (#1954) 2026-05-31 18:21:07 +01:00
value-ref-dispatchability.test.ts fix(python): find dependents of constants and passed functions (#3957) 2026-11-16 16:42:30 +00:00
value-ref-namespace-precedence.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
walkers-augmentations.test.ts fix(csharp): rank global-namespace types below the file's own namespaces (#3655) 2026-10-22 06:35:08 +00:00
wildcard-collision-export-evidence.test.ts fix(ingestion): resolve TypeScript receivers and ECMAScript exports (#4039) 2026-11-24 12:48:10 +00:00
wildcard-topLevelOnly-gate.test.ts refactor(scope-resolution): put import visibility behind one interface (#3908) 2026-11-13 19:47:00 +00:00
workspace-index.test.ts fix(swift): resolve inherited protocol extension calls (#3309) 2026-09-19 07:44:35 +01:00