binding/occurrence: Resolve names in quoted expressions#801
Merged
Conversation
References, rename, document highlights, and unused-import diagnostics could miss or misclassify identifiers inside quoted expressions. Generated arguments could also be confused with same-named inner bindings, producing incomplete references and unsafe rename edits. Introduce a shared inert resolver for target selection and occurrence collection. Code-shaped ordinary quotes resolve in their construction module, macro quotes in definition scope, and generated bodies in a synthetic function scope with exact argument remapping. Direct interpolation remains in its enclosing lexical scope, while nested generated-output interpolation follows its corresponding quote stage. Track quote and interpolation stages when classifying nested macrocalls. Support one-argument `@eval` in bare and `Base.@eval` forms, `@generated` and `Base.@generated`, and direct `esc(...)` or `Base.esc(...)` boundaries. Two-argument `@eval` and escaped free names remain unresolved. This intentionally uses a pragmatic construction-site approximation. Atomic `Symbol` flow, indirect escape flow, nested quoted values inside `@eval`, general qualified or aliased new-style macro resolution, and confidence-aware filtering of generated temporary expressions remain future work. Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #801 +/- ##
==========================================
+ Coverage 78.29% 78.59% +0.30%
==========================================
Files 62 62
Lines 13257 13398 +141
==========================================
+ Hits 10379 10530 +151
+ Misses 2878 2868 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
References, rename, document highlights, and unused-import diagnostics could miss or misclassify identifiers inside quoted expressions. Generated arguments could also be confused with same-named inner bindings, producing incomplete references and unsafe rename edits.
Introduce a shared inert resolver for target selection and occurrence collection. Code-shaped ordinary quotes resolve in their construction module, macro quotes in definition scope, and generated bodies in a synthetic function scope with exact argument remapping. Direct interpolation remains in its enclosing lexical scope, while nested generated-output interpolation follows its corresponding quote stage.
Track quote and interpolation stages when classifying nested macrocalls. Support one-argument
@evalin bare andBase.@evalforms,@generatedandBase.@generated, and directesc(...)orBase.esc(...)boundaries. Two-argument@evaland escaped free names remain unresolved.This intentionally uses a pragmatic construction-site approximation. Atomic
Symbolflow, indirect escape flow, nested quoted values inside@eval, general qualified or aliased new-style macro resolution, and confidence-aware filtering of generated temporary expressions remain future work.