Skip to content

Backport "Add suppression if nowarn differs" to 3.3 LTS #546

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 2 commits into from
Aug 8, 2025

Conversation

tgodzik
Copy link

@tgodzik tgodzik commented Aug 8, 2025

Backports scala#23652 to the 3.3.7.

PR submitted by the release tooling.
[skip ci]

som-snytt and others added 2 commits August 8, 2025 08:48
Fixes scala#23651

The [previous fix](scala#22383) for the
same `@nowarn` attached to multiple elements should have compared the
`annotPos` to identify duplicates (instead of the target range).

This commit defers detecting "bad" or duplicate suppressions (which
originate with the same annotation) to report time, after the
suppression is "unused"; there are few nowarns per file and fewer that
are unused.

While checking for a suppression, mark matching unused suppressions as
"superseded", so that if they remain unused, the warning can add an
"audit" that the nowarn matched a diagnostic (but was superseded by some
other nowarn).

~This commit goes further and checks for duplicates (including whether
the filters look the same).~

~If it finds a duplicate where the `annotPos` differs, warn about the
user-written annotation.~

~Filters match each other if they are the same type and, if they have a
pattern, the string representations of the patterns are equal.~
Fixes scala#23651 

The [previous fix](scala#22383) for the
same `@nowarn` attached to multiple elements should have compared the
`annotPos` to identify duplicates (instead of the target range).

This commit defers detecting "bad" or duplicate suppressions (which
originate with the same annotation) to report time, after the
suppression is "unused"; there are few nowarns per file and fewer that
are unused.

While checking for a suppression, mark matching unused suppressions as
"superseded", so that if they remain unused, the warning can add an
"audit" that the nowarn matched a diagnostic (but was superseded by some
other nowarn).

~This commit goes further and checks for duplicates (including whether
the filters look the same).~

~If it finds a duplicate where the `annotPos` differs, warn about the
user-written annotation.~

~Filters match each other if they are the same type and, if they have a
pattern, the string representations of the patterns are equal.~
[Cherry-picked 40843f7][modified]
Base automatically changed from backport-lts-3.3-23634 to lts-3.3 August 8, 2025 13:53
@tgodzik
Copy link
Author

tgodzik commented Aug 8, 2025

No regressions detected in the community build up to backport-lts-3.3-23628.

Reference

@tgodzik tgodzik merged commit e6a12af into lts-3.3 Aug 8, 2025
22 checks passed
@tgodzik tgodzik deleted the backport-lts-3.3-23652 branch August 8, 2025 13:53
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.

2 participants