mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-21 00:21:30 +00:00
Closes the final 4 parity failures (4 → 0). C# now runs the
registry-primary scope-resolution path by default — added to
MIGRATED_LANGUAGES.
Changes:
- `scope-resolution/scope/walkers.ts`: was already extended in
Unit 6a to recognize Interface/Struct/Record/Enum as class-like
owners (interface default methods get ownerIds).
- `scope-resolution/passes/receiver-bound-calls.ts`: build
IMPLEMENTS edge index → emit secondary `interface-dispatch`
CALLS edges to every implementor's same-named member when the
primary receiver-typed edge targets an Interface method (closes
heritage CreateUser CALLS-count test).
- `scope-resolution/passes/receiver-bound-calls.ts`: new
`pickOverload` helper narrows multi-valued
`membersByOwner.get(owner).get(name)` candidates by arity then
argument types. Replaces the first-seen `findOwnedMember` lookup
in Case 4 so receiver-typed overloaded calls pick the right def.
- `scope-resolution/passes/free-call-fallback.ts`: new
`pickImplicitThisOverload` walks up to the enclosing class scope
and applies the same arity + argument-type narrowing for free
calls inside a class body (`Lookup("alice")` → `Lookup(string)`).
- `scope-resolution/workspace-index.ts`: new `membersByOwner`
multi-valued index (`Map<owner, Map<name, Def[]>>`) preserves
every overload alongside the existing first-seen `memberByOwner`.
- `scope-resolution/graph-bridge/node-lookup.ts` +
`scope-resolution/graph-bridge/ids.ts`: include parameter-types
suffix in the qualified lookup key for Method nodes. Legacy
parse-phase encodes the type tag into the node id (`Method:f.cs:
UserService.Lookup#1~int`); without this two same-arity overloads
collapsed to one lookup entry and routed to the wrong graph node.
- `scope-resolution/contract/scope-resolver.ts`: new
`collapseMemberCallsByCallerTarget` opt-in flag (was added in
Unit 6b for member-call dedup; documented here).
- `gitnexus-shared/src/scope-resolution/reference-site.ts`: new
`argumentTypes` field carrying inferred per-arg types.
- `scope-extractor.ts`: read @reference.parameter-types capture into
`site.argumentTypes` and add it + the declaration-arity tags to
KNOWN_SUB_TAGS so the anchor-detection picks the right anchor.
- `languages/csharp/captures.ts`: synthesize @reference.parameter-types
by inferring arg types from literal AST nodes (integer_literal →
'int', string_literal → 'string', constructor_expression →
type-name, etc).
- `languages/csharp/scope-resolver.ts`: opt in to
`collapseMemberCallsByCallerTarget`.
- `registry-primary-flag.ts`: **add CSharp to MIGRATED_LANGUAGES**.
Final state:
- C# parity: 175/175 green on flag-on AND flag-off.
- Python parity: 204/204 green on both flag paths (no regression).
- TypeScript clean.
51 → 0 failures across 18 commits on `feat/csharp-scope-resolution`.
|
||
|---|---|---|
| .. | ||
| src | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||