Repository navigation
fix(csharp): bind a call on a constructed generic type (Bag<T>.Make()) - #2676
rohit-jsfreaky wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR addresses C# call-site handling when explicit type arguments are present (e.g., X.M<T>(), Bag<Payload>.Make(), Local<Payload>()). It adds a new helper _csharp_name_without_type_args that strips the type-argument list from generic_name nodes, and updates _extract_generic to use it for callee names and receivers, while also recognizing generic_name as a valid receiver/function node type alongside identifier. The test file adds a new suite of cases covering explicit type arguments on type receivers, typed local receivers, constructed generic type receivers (split across files), unqualified/this generic calls, and a check that type-argument stripping doesn't bypass receiver typing. The changed surface is limited to the C# path in graphify/extractors/engine.py and the corresponding tests in tests/test_csharp_member_calls.py.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 650 functions depend on the 255 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
walk_calls()— 1 callers, 16 callees
Verification — 650 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 591 function(s) in the blast radius were not formally verified this run
· 1 more finding(s) on lines outside this diff (see the check run).
|
Thank's again. Hope this PR will be released soon. |
|
How did this pull request backlog come about? Is there anything we can do to help here? It's unusual for completed items to sit here for two weeks. |
8750f61 to
b0ad6e4
Compare
|
Rebased onto I also re-checked that this is not already covered by #2911 / #2913, since those mention generic type arguments too. Those walk them in field / property / return / parameter position, which is type-reference resolution; the call-site callee and receiver naming is a separate path. The repro still fails the same way on 0.9.49 — 3 of 8 shapes resolve without this change, 8 of 8 with it. Full suite on the rebased branch: 12 failed, 4986 passed, 43 skipped — the same 12 as a clean |
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Fixes dropped C# calls edges when a call site spells explicit type arguments (Registry.Fetch<Payload>(...), Bag<Payload>.Make(...), Local<Payload>(...)), which tree-sitter wraps in a generic_name whose verbatim text (Fetch<Payload>) never matched the bare declaration name. Adds _csharp_name_without_type_args, which returns the bare identifier off a generic_name (falling back to splitting on < for qualified generics like Demo.Bag<Payload>), and routes callee names, Type.M() receivers, and unqualified/this calls through it so type-argument lists are stripped before lookup while receiver typing still applies.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 692 functions depend on the 280 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_extract_generic()— 18 callers, 24 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
extract_objc()— 27 callers, 9 callees - new:
extract_js()— 80 callers, 3 callees - new:
extract_julia()— 17 callers, 7 callees - new:
extract_cpp()— 27 callers, 3 callees - new:
extract_vue()— 10 callers, 6 callees - new:
walk()— 1 callers, 56 callees - …and 8 more — each is listed as a finding
Verification — 692 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 632 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify \_extract\_generic.
The verifier did not have enough to check \_extract\_generic, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set
· 16 more finding(s) on lines outside this diff (see the check run).
|
Are there any plausible reasons why this hasn't been merged in weeks? The PR looks fine to me. |
|
I reported #2624. Instead of asking about timing again, here is a measurement, because the two 1. The defect is still in the shipped release. I ran a minimal reproducer against
3 of 8 before, 8 of 8 after, controls unchanged. Every target member node already exists, so 2. The patch still applies to the current head. 3. The red tests are pre-existing and environmental, not caused by this PR. The rebase note
The two failing sets are name-for-name identical (diff of the two 4. One honest caveat, which I raised in the issue myself. A generic call site whose receiver 5. It is now the last gap in this path. v0.9.55 already emits Weight in a real estate, ~15,300 C# files across seven roots, mixed .NET Framework and net8,
|
b0ad6e4 to
5832e82
Compare
|
Rebased onto 0.9.86. #3406 already strips type arguments from the method name, so this PR now covers only the case still broken there: a call on a constructed generic type ( |
Bag<T>.Make())
5832e82 to
c14d2a8
Compare
…)`) (Graphify-Labs#2624) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B8gwEpjajiWHVW3c9smuKf
c14d2a8 to
6b76340
Compare
Fixes #2624 (the part still open on 0.9.86).
Summary
Bag<Payload>.Make()gets nocallsedge. The receiver is a constructed generic type, which tree-sitter wraps in ageneric_name, and the C# member-call handler only captured a receiver that was a plainidentifier. The receiver was dropped, so_resolve_csharp_member_callshad nothing to bind.The rest of #2624 (type arguments on the method name:
Registry.Fetch<Payload>(),box.Read<Payload>(),Local<Payload>()) is already fixed on v8 by #3406's_csharp_bare_call_name. This PR was first written before that landed; it is now rebased onto 0.9.86 and reduced to the one case still broken.Change
graphify/extractors/engine.py: a member call's receiver may also be ageneric_name, read through_csharp_bare_call_name(the type-argument list off), soBag<Payload>.Make()binds like anyType.M(). Type nodes are stored under the bare name. C# only; nothing else reads this branch.This does not loosen resolution: the receiver still goes through receiver typing and the god-node guard, so an untypable receiver still gets no edge.
Tests
Five tests appended to
tests/test_csharp_member_calls.py.test_constructed_generic_type_as_receiverfails on clean 0.9.86 and passes here; the other four (explicit type argument on a type receiver and on a typed local,Local<T>()/this.Local<T>(), and the #1609 guard through a generic call) pass on 0.9.86 and stay as regression tests for #2624. The generic-receiver test is split across two files on purpose: in one file the callee resolves by an in-file label match and never reaches receiver typing.The 3 failures (
test_absolute_path_lookup_skips_getcwdx2,test_3357_minimal_reproduction_no_config_emits_calls_edge) fail on clean 0.9.86 on this Windows machine too.🤖 Generated with Claude Code
https://claude.ai/code/session_01B8gwEpjajiWHVW3c9smuKf