forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit 4059d1c
committed
Add suppression if nowarn differs (scala#23652)
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]1 parent b60dae3 commit 4059d1cCopy full SHA for 4059d1c
File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedFilter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changed
0 commit comments