Skip to content

Commit add86fa

Browse files
committed
enable cat=unchecked filter for WConf / nowarn
1 parent 4d1cb88 commit add86fa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private sealed trait WarningSettings:
144144
|<filter>
145145
| - Any message: any
146146
|
147-
| - Message categories: cat=deprecation, cat=feature
147+
| - Message categories: cat=deprecation, cat=feature, cat=unchecked
148148
|
149149
| - Message content: msg=regex
150150
| The regex need only match some part of the message, not all of it.

compiler/src/dotty/tools/dotc/reporting/WConf.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ enum MessageFilter:
1515
case Any => true
1616
case Deprecated => message.isInstanceOf[Diagnostic.DeprecationWarning]
1717
case Feature => message.isInstanceOf[Diagnostic.FeatureWarning]
18+
case Unchecked => message.isInstanceOf[Diagnostic.UncheckedWarning]
1819
case MessagePattern(pattern) =>
1920
val noHighlight = message.msg.rawMessage.replaceAll("\\e\\[[\\d;]*[^\\d;]","")
2021
pattern.findFirstIn(noHighlight).nonEmpty
2122
case MessageID(errorId) => message.msg.errorId == errorId
2223
case None => false
2324
}
24-
case Any, Deprecated, Feature, None
25+
case Any, Deprecated, Feature, Unchecked, None
2526
case MessagePattern(pattern: Regex)
2627
case MessageID(errorId: ErrorMessageID)
2728

@@ -70,6 +71,7 @@ object WConf:
7071
case "cat" => conf match
7172
case "deprecation" => Right(Deprecated)
7273
case "feature" => Right(Feature)
74+
case "unchecked" => Right(Unchecked)
7375
case _ => Left(s"unknown category: $conf")
7476
case _ => Left(s"unknown filter: $filter")
7577
case _ => Left(s"unknown filter: $s")

0 commit comments

Comments
 (0)