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:
152152 | - Message id: id=E129
153153 | The message id is printed with the warning.
154154 |
155+ | - Message name: name=PureExpressionInStatementPosition
156+ | The message name is printed with the warning in verbose warning mode.
157+ |
155158 |In verbose warning mode the compiler prints matching filters for warnings.
156159 |Verbose mode can be enabled globally using `-Wconf:any:verbose`, or locally
157160 |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 {
155155 sb.append(EOL ).append(" Matching filters for @nowarn or -Wconf:" )
156156 if (hasId)
157157 sb.append(EOL ).append(" - id=E" ).append(msg.errorId.errorNumber)
158+ sb.append(EOL ).append(" - name=" ).append(msg.errorId.productPrefix.stripSuffix(" ID" ))
158159 if (category.nonEmpty)
159160 sb.append(EOL ).append(" - cat=" ).append(category)
160161
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ object WConf:
6969 Left (s " unknonw error message id: E $n" )
7070 case _ =>
7171 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+
7276 case " cat" => conf match
7377 case " deprecation" => Right (Deprecated )
7478 case " feature" => Right (Feature )
You can’t perform that action at this time.
0 commit comments