Skip to content

Add accessible check for import usage #23348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jun 10, 2025

Fixes #23347

The code for deciding whether a selector is used to import a symbol was missing a check for accessibility (importability).

3.6.4 doesn't warn, so it would be nice to know why it excludes the member. The algorithm is different but the code for choosing import selectors is similar. 3.7.0 also doesn't warn, but no change stands out as a culprit. Possibly the selector was spuriously excluded (by result caching in 3.7.0).

@som-snytt som-snytt force-pushed the issue/23347-import-private-alias branch 2 times, most recently from fc0efa7 to 1ecd165 Compare June 11, 2025 17:27
@som-snytt som-snytt force-pushed the issue/23347-import-private-alias branch from 1ecd165 to c76b42f Compare July 6, 2025 17:43
@som-snytt som-snytt marked this pull request as ready for review July 6, 2025 17:44
@Gedochao Gedochao requested a review from tgodzik July 7, 2025 11:54
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik tgodzik merged commit 35c2ef3 into scala:main Jul 7, 2025
29 checks passed
@som-snytt som-snytt deleted the issue/23347-import-private-alias branch July 7, 2025 15:08
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.

Incorrect unused import warnings in some cases - private definitions escaping their scope
2 participants