Skip to content

Commit b1a81bb

Browse files
committed
fix: Closes #18367 -Wconf options are processed incorrectly
[Cherry-picked 16dd58f][modified]
1 parent cb56072 commit b1a81bb

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ object WConf:
119119
def fromSettings(settings: List[String]): Either[List[String], WConf] =
120120
if (settings.isEmpty) Right(WConf(Nil))
121121
else
122-
val parsedConfs: List[Either[List[String], (List[MessageFilter], Action)]] = settings.map(conf =>
122+
val parsedConfs: List[Either[List[String], (List[MessageFilter], Action)]] = settings.reverse.map(conf =>
123123
val filtersAndAction = conf.split(':')
124124
if filtersAndAction.length != 2 then Left(List("exactly one `:` expected (<filter>&...&<filter>:<action>)"))
125125
else

compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala

-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class ScalaSettingsTests:
8989
val nowr = new Diagnostic.Warning("This is a problem.".toMessage, util.NoSourcePosition)
9090
assertEquals(Action.Silent, sut.action(nowr))
9191

92-
@Ignore("LTS backport rejected: https://github.com/scala/scala3/pull/18503")
9392
@Test def `i18367 rightmost WConf flags take precedence over flags to the left`: Unit =
9493
import reporting.{Action, Diagnostic}
9594
val sets = new ScalaSettings
@@ -186,7 +185,6 @@ class ScalaSettingsTests:
186185
)
187186
)
188187

189-
@Ignore("LTS backport rejected: https://github.com/scala/scala3/pull/18503")
190188
@Test def `WConf src filter can be mixed with other filters with rightmost taking precedence`: Unit =
191189
val result = wconfSrcFilterTest(
192190
argsStr = "-Wconf:src=.*:s,cat=deprecation:e",

0 commit comments

Comments
 (0)