Skip to content

diagnostic: Fix unused-import for bindings used in quoted expressions#595

Merged
aviatesk merged 1 commit intomasterfrom
avi/594
Mar 14, 2026
Merged

diagnostic: Fix unused-import for bindings used in quoted expressions#595
aviatesk merged 1 commit intomasterfrom
avi/594

Conversation

@aviatesk
Copy link
Owner

Previously, collect_inert_global_occurrences! was only called for @generated functions, so imports used inside quoted expressions (:(...)) in macro bodies or helper functions were falsely reported as unused. Remove the is_generated guard so that global bindings inside inert nodes are always collected during binding occurrence analysis.

Additionally, strip $ (interpolation) nodes via without_kinds before lowering inert content, so that non-interpolated identifiers in expressions like :(length(($x,))) are still resolved.

Closes #594

Previously, `collect_inert_global_occurrences!` was only called for
`@generated` functions, so imports used inside quoted expressions
(`:(...)`) in macro bodies or helper functions were falsely reported
as unused. Remove the `is_generated` guard so that global bindings
inside inert nodes are always collected during binding occurrence
analysis.

Additionally, strip `$` (interpolation) nodes via `without_kinds`
before lowering inert content, so that non-interpolated identifiers
in expressions like `:(length(($x,)))` are still resolved.

Closes #594

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.87%. Comparing base (9b9e391) to head (56226c0).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #595      +/-   ##
==========================================
- Coverage   67.87%   67.87%   -0.01%     
==========================================
  Files          51       51              
  Lines        8303     8302       -1     
==========================================
- Hits         5636     5635       -1     
  Misses       2667     2667              
Flag Coverage Δ
JETLS.jl 67.87% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aviatesk aviatesk merged commit 75d7d46 into master Mar 14, 2026
18 of 19 checks passed
@aviatesk aviatesk deleted the avi/594 branch March 14, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive lowering/unused-import for bindings used within generator function

1 participant