Skip to content

Collect nowarn symbols instead of skipping them#22766

Merged
som-snytt merged 1 commit intoscala:mainfrom
som-snytt:port/t13095
Mar 11, 2025
Merged

Collect nowarn symbols instead of skipping them#22766
som-snytt merged 1 commit intoscala:mainfrom
som-snytt:port/t13095

Conversation

@som-snytt
Copy link
Copy Markdown
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
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.

5 participants