Repository navigation
fix(csharp): resolve unqualified generic call sites, Get<int>(...) (#3406) - #3422
abhay-codes07 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).
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Fixes C# generic call sites (Get<int>(...), this.Get<int>(...), Make<int>()) dropping their calls edges by resolving the callee to the bare identifier via _csharp_bare_call_name, which strips the type-argument list from a generic_name node so the call matches the actual method instead of the verbatim Get<int> text. Adds a generic_name arm to the unqualified-invocation handler in _extract_generic (member and identifier calls were already covered) and tests covering the base-class, this-qualified, and same-class cases plus regression guards that no target retains bracketed text.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 665 functions depend on the 224 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_extract_generic()— 18 callers, 26 callees - new:
extract_js()— 85 callers, 4 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
extract_objc()— 27 callers, 9 callees - new:
extract_julia()— 17 callers, 7 callees - new:
extract_cpp()— 27 callers, 3 callees - new:
extract_vue()— 10 callers, 7 callees - new:
walk()— 1 callers, 58 callees - …and 8 more — each is listed as a finding
Verification — 665 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: 605 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
22 of 260 test file(s) selected (8%) via static blast radius.
tests/test_astro_extraction.py— impacttests/test_build.py— impacttests/test_cjs_module_extension.py— impacttests/test_cpp_nested_and_cli.py— impacttests/test_csharp_generic_callsites.py— impact, changed-testtests/test_dotnet.py— impacttests/test_extract.py— impacttests/test_import_extension_resolution.py— impacttests/test_indirect_dispatch.py— impacttests/test_indirect_dispatch_assign_return.py— impacttests/test_indirect_dispatch_getattr.py— impacttests/test_js_exported_scalar_bindings.py— impacttests/test_languages.py— impacttests/test_multilang.py— impacttests/test_python_underscore_resolution.py— impacttests/test_rationale.py— impacttests/test_ruby_resolution.py— impacttests/test_scala_self_type.py— impacttests/test_swift_computed_properties.py— impacttests/test_ts_new_expression_calls.py— impacttests/test_typescript_module_extensions.py— impacttests/test_vue_extraction.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
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).
|
Shipped in v0.9.57 — landed on |
Closes #3406.
The problem
A C# call with an explicit type argument and no receiver never got a
callsedge —Get<int>("port"),this.Get<int>("port"),Make<int>()all dropped it while the non-generic spellings resolved, exactly as the issue's 5-case table shows (reproduced verbatim on 0.9.56).The invocation handler has arms for a
member_access_expressionfunction node and anidentifierone.Get<int>(...)parses as ageneric_name, so it fell to the raw-text fallback and the callee was captured asGet<int>— brackets and all — which can never match the.Get()member node.this.Get<int>(...)failed one arm earlier: the member branch read thenamefield's raw text, and that field is the samegeneric_name.The change
A small helper,
_csharp_bare_call_name, reads the identifier child of ageneric_name(and passes a plainidentifierthrough untouched). The member arm uses it for the name field, and the unqualified path gains ageneric_namearm beside theidentifierone. The type-argument list is not part of the method's identity, so the callee is the bare name — after that, same-class and base-class resolution work exactly as they do for the non-generic controls. The #2911generic_argreference emission reads the type-argument list off the same nodes and is untouched.Tests
tests/test_csharp_generic_callsites.py— 5 tests on the issue's exact 3-file repro: the unqualified base-class call, thethis.-qualified call, and the same-class call all resolve; no target ever derives from the bracketed raw text; and the two non-generic controls keep resolving. With the fix reverted, 3 of 5 fail (the controls rightly keep passing). The C# suites are unchanged (174 passed); the full suite matches a fresh same-versionv8(0.9.56) baseline.🤖 Generated with Claude Code
https://claude.ai/code/session_01JJbLfztSxm2tH5cJwBbe9q