Repository navigation
Conversation
…es (Graphify-Labs#3797) ((IStore)_obj).Save() and (_obj as IStore).Save() produced no calls edge: the receiver capture didn't handle a parenthesized cast, so the call never reached the receiver-typed resolver. Use the cast's type as the receiver so it resolves like IStore.Save(). IStore Store => ...; Store.Save() bound to the concrete Store.Save() because a capitalised receiver was looked up as a type name first. A field, property or local of that name shadows the type, so try the recorded receiver_type first and fall back to the type name. Co-Authored-By: Grok Bot <[email protected]>
|
Thanks for the pull request, @Mpasha17. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Formal verification. PR-changed functions: 0/2 verified (0 proven, 0 may-equivalent, 0 distinguished) · 2 not verified (1 vacuous, 1 unsupported).
Not verified on this run: \_resolve\_csharp\_member\_calls (vacuous: never exercised), \_extract\_generic (unsupported).
Graphify review — findings
Fixes C# member-call resolution so a Pascal-cased receiver that names a field, property, or local in scope resolves to that member's declared type. For example, IStore Store => ...; Store.Save() now links to IStore.Save, not the class Store's method, and it falls back to treating the receiver as a type name only when no declared type is known. Cast receivers like ((IStore)x).Save() and (x as IStore).Save() also resolve against the cast type, with tests covering all three cases (#3797).
Worth a look
- Unresolved shadow receiver falls back to same-named type —
graphify/extract.py:4689· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 2769 functions depend on the 611 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 778 callers, 50 callees - new:
_rebuild_code()— 149 callers, 56 callees - new:
_extract_generic()— 18 callers, 31 callees - new:
extract_js()— 87 callers, 4 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
main()— 102 callers, 3 callees - new:
dispatch_command()— 2 callers, 128 callees - new:
extract_objc()— 27 callers, 9 callees - …and 48 more — each is listed as a finding
Verification — 2769 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: 2579 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
147 of 334 test file(s) selected (44%) via static blast radius.
tests/test_astro_extraction.py— impacttests/test_astro_import_ids.py— impacttests/test_blade_extractor.py— impacttests/test_build.py— impacttests/test_builtin_global_type_refs.py— impacttests/test_cache.py— impacttests/test_case_sensitive_resolution.py— impacttests/test_cjs_module_extension.py— impacttests/test_cobol_extractor.py— impacttests/test_cpp_method_declarations.py— impacttests/test_cpp_nested_and_cli.py— impacttests/test_cpp_objc_cross_file_calls.py— impacttests/test_cross_extension_reexport_self_cycle.py— impacttests/test_cross_language_call_resolution.py— impacttests/test_cross_repo_external_call_guards.py— impacttests/test_cross_repo_member_calls.py— impacttests/test_csharp_call_site_generic_args.py— impacttests/test_csharp_enum_members.py— impacttests/test_csharp_field_generic_args.py— impacttests/test_csharp_generic_callsites.py— impacttests/test_csharp_interface_dispatch.py— impacttests/test_csharp_member_calls.py— impact, changed-testtests/test_csharp_member_nodes.py— impacttests/test_csharp_object_creation.py— impacttests/test_csharp_partial_classes.py— impacttests/test_csharp_tuple_type_refs.py— impacttests/test_csharp_type_resolution.py— impacttests/test_definition_file_portability.py— impacttests/test_detect.py— impacttests/test_dotnet.py— impacttests/test_duplicate_annotation_edges.py— impacttests/test_elixir_import_resolution.py— impacttests/test_elixir_unqualified_call_scope.py— impacttests/test_erlang_extractor.py— impacttests/test_extract.py— impacttests/test_extract_cache_location.py— impacttests/test_extract_php_closures.py— impacttests/test_file_label_disambiguation.py— impacttests/test_file_node_id_spec.py— impacttests/test_forwarding_review_findings.py— impacttests/test_go_builtin_call_targets.py— impacttests/test_go_import_repoint.py— impacttests/test_go_interface_methods.py— impacttests/test_go_qualified_resolution.py— impacttests/test_import_extension_resolution.py— impacttests/test_import_self_loops.py— impacttests/test_imported_export_forwarding.py— impacttests/test_incremental.py— impacttests/test_indirect_call_arrow_single_param_shadow.py— impacttests/test_indirect_call_block_scoped_shadow.py— impact- … and 97 more
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 \_resolve\_csharp\_member\_calls.
The verifier did not have enough to check \_resolve\_csharp\_member\_calls, 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: no capturable inputs from the test suite; property tier: non-vacuity: domain too small (only 1 distinct inputs exercised, need 3) — 'no divergence' would be near-vacuous
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: no capturable inputs from the test suite; property tier: parameter `config` is annotated `LanguageConfig` — outside the synthesizable primitive/collection set
· 56 more finding(s) on lines outside this diff (see the check run).
|
Checked this one live: with |
Part of #3797. Two of the dropped C# call shapes from the issue:
((IStore)_obj).Save()/(_obj as IStore).Save()got nocallsedge. The receiver capture didn't handle a parenthesized cast, so the call never reached the member resolver. The cast's type is now used as the receiver, so it resolves likeIStore.Save().IStore Store => ...; Store.Save()resolved to the concreteStore.Save(), because a capitalised receiver was looked up as a type name first. A field/property/local of that name shadows the type in C#, so the recordedreceiver_typeis now tried first, with the type-name lookup as fallback.The
?.case was already fixed by #3976.Left out the partial-class case: it only misses when another class has a method with the same name, and fixing it (~8 lines) changes how every unqualified C# call gets resolved, so it felt riskier. Happy to send it as a separate PR if you want it.
Testing: 3 new tests in
tests/test_csharp_member_calls.py(cast,ascast, property shadowing a type name), all fail on v8. Full suite on 3.10/3.12/3.13/3.14 with all extras: same failures as v8 on every version (only the existingtest_dm_*/ tree-sitter-dm, wheel-payload and known-flaky ones), plus the 3 new passes. ruff clean, pyright error count unchanged on the touched files. Live withgraphify update --no-clusteron the issue's repro plus anasvariant: v8 hasRun -> Store.Save()and nothing for(_obj as IStore).Save(); this branch hasRun -> IStore.Save()andRunAs -> IStore.Save(), no other edges changed.AI-assisted (Grok Bot); each commit carries a Co-Authored-By line.