Skip to content

Collect nowarn symbols instead of skipping them #22766

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
Mar 11, 2025

Conversation

som-snytt
Copy link
Contributor

Forward port scala/scala#11012

Associated patvars must be processed together: a patvar is unused if no associated symbol is used. Therefore a patvar can't be skipped if it is marked @nowarn (for example, it has the name of the corresponding case class element). Instead, collect those symbols; then, a patvar is warnable if no associated symbol is marked nowarn.

The case class example is "no warn", even though it introduces private members. (Scala 2 has the same behavior.)

@som-snytt som-snytt marked this pull request as ready for review March 11, 2025 03:42
@Gedochao Gedochao requested a review from KacperFKorban March 11, 2025 07:13
@som-snytt som-snytt merged commit d0a11e0 into scala:main Mar 11, 2025
29 checks passed
@som-snytt som-snytt deleted the port/t13095 branch March 11, 2025 14:11
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 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.

3 participants