Skip to content

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
@Gedochao Gedochao requested a review from tgodzik June 9, 2025 14:16
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

@som-snytt som-snytt merged commit 0163e4a into scala:main Jun 11, 2025
29 checks passed
@som-snytt som-snytt deleted the issue/23323-nowarn-selectable branch June 11, 2025 16:19
@WojciechMazur WojciechMazur added this to the 3.7.2 milestone Jun 18, 2025
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
3 participants