Skip to content

Take inferred or explicit refinement result for unused check #23325

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

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

Previously, the check considered an explicit refinement to "nowarn" the corresponding member of an anonymous class.

Since an anonymous Selectable will infer a refinement type, use the type for the relaxed warning.

Arguably, it would still be useful to warn for the scala.Selectable case, where it may be that selectDynamic is the preferred interface, but that is not done here. As with other anonymous classes, an explicit type can be used instead (to request a warning for Selectable or silence a warning for other classes).

Fixes #23323

@som-snytt som-snytt marked this pull request as ready for review June 6, 2025 18:50
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.

Exclude Selectable from unused member warning
1 participant