Skip to content

Commit

Permalink
fix: Closes #18367 -Wconf options are processed incorrectly
Browse files Browse the repository at this point in the history
[Cherry-picked 16dd58f][modified]
  • Loading branch information
prolativ committed Nov 21, 2024
1 parent cb56072 commit b1a81bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/reporting/WConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ object WConf:
def fromSettings(settings: List[String]): Either[List[String], WConf] =
if (settings.isEmpty) Right(WConf(Nil))
else
val parsedConfs: List[Either[List[String], (List[MessageFilter], Action)]] = settings.map(conf =>
val parsedConfs: List[Either[List[String], (List[MessageFilter], Action)]] = settings.reverse.map(conf =>
val filtersAndAction = conf.split(':')
if filtersAndAction.length != 2 then Left(List("exactly one `:` expected (<filter>&...&<filter>:<action>)"))
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class ScalaSettingsTests:
val nowr = new Diagnostic.Warning("This is a problem.".toMessage, util.NoSourcePosition)
assertEquals(Action.Silent, sut.action(nowr))

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

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

0 comments on commit b1a81bb

Please sign in to comment.