File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,9 @@ private sealed trait WarningSettings:
152
152
| - Message id: id=E129
153
153
| The message id is printed with the warning.
154
154
|
155
+ | - Message name: name=PureExpressionInStatementPosition
156
+ | The message name is printed with the warning in verbose warning mode.
157
+ |
155
158
|In verbose warning mode the compiler prints matching filters for warnings.
156
159
|Verbose mode can be enabled globally using `-Wconf:any:verbose`, or locally
157
160
|using the @nowarn annotation (example: `@nowarn("v") def test = try 1`).
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ trait MessageRendering {
155
155
sb.append(EOL ).append(" Matching filters for @nowarn or -Wconf:" )
156
156
if (hasId)
157
157
sb.append(EOL ).append(" - id=E" ).append(msg.errorId.errorNumber)
158
+ sb.append(EOL ).append(" - name=" ).append(msg.errorId.productPrefix.stripSuffix(" ID" ))
158
159
if (category.nonEmpty)
159
160
sb.append(EOL ).append(" - cat=" ).append(category)
160
161
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ object WConf:
69
69
Left (s " unknonw error message id: E $n" )
70
70
case _ =>
71
71
Left (s " invalid error message id: $conf" )
72
+ case " name" =>
73
+ try Right (MessageID (ErrorMessageID .valueOf(conf + " ID" )))
74
+ catch case _ : IllegalArgumentException => Left (s " unknown error message name: $conf" )
75
+
72
76
case " cat" => conf match
73
77
case " deprecation" => Right (Deprecated )
74
78
case " feature" => Right (Feature )
You can’t perform that action at this time.
0 commit comments