fix(resolution): literal-receiver builtins and nested locals stop fabricating call edges - #1317
Merged
Merged
Conversation
…ricating call edges ", ".join(sorted(x)) resolved by bare name to a project function named join — one nested inside a DIFFERENT function, so scope alone rules the edge out. Both defects from #1230, fixed independently: 1. Extraction: a member call on a LITERAL receiver (string, number, collection, regex — across grammars) emits no call ref at all. A literal's methods are the language's builtins, never project symbols; the bare-name fallback let them exact-match any same-named project function. Silent miss, never a wrong edge. 2. Resolution: matchByExactName filters out candidates nested inside a same-file FUNCTION container unless the ref originates within that container's line range. Class members (parent is a class-like node), top-level symbols, and C++ namespace prefixes (no parent node) are untouched. requests re-index: byte-identical (813 calls edges). excalidraw: -27 edges, all literal-receiver refs by construction. The issue's repro is pinned: join has exactly one caller (format_fields), report_missing has zero project callees. Fixes #1230 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1230.
Both stacked failures from the report, fixed independently (your "OR" turned into an "AND" — each defect can fire alone):
Literal receivers (extraction): a member call on a literal —
", ".join(...),"x".toUpperCase(),5.times,[].concat(...), across grammars — now emits no call ref. A literal's methods are builtins, never project symbols; previously the receiver was dropped and the bare name could exact-match any same-named project function. This is yourliteralReceiverTypessuggestion, implemented once in the shared extractor rather than per-language, so it can't drift.Nested-local reachability (resolution): your scope argument, applied at the exact-match strategy — a candidate nested inside a same-file function container (detected via its qualified name, e.g.
format_fields::join) only resolves from refs inside that container's line range. Class members, top-level symbols, and C++ namespace-prefixed names are structurally exempt.Verification
joinhas exactly one caller (format_fields);report_missinghas zero project callees.get/update/closecommonality you predicted).🤖 Generated with Claude Code