@@ -89,6 +89,7 @@ class ScalaSettingsTests:
8989 val nowr = new Diagnostic .Warning (" This is a problem." .toMessage, util.NoSourcePosition )
9090 assertEquals(Action .Silent , sut.action(nowr))
9191
92+ <<<<<<< lts- 3.3 - backport- 18503
9293 @ Ignore (" LTS backport rejected: https://github.com/scala/scala3/pull/18503" )
9394 @ Test def `i18367 rightmost WConf flags take precedence over flags to the left` : Unit =
9495 import reporting .{Action , Diagnostic }
@@ -199,5 +200,20 @@ class ScalaSettingsTests:
199200 )
200201 )
201202 assertEquals(result, Right (reporting.Action .Error ))
203+ =======
204+ @ Test def `i18367 rightmost WConf flags take precedence over flags to the left` : Unit =
205+ import reporting .{Action , Diagnostic }
206+ val sets = new ScalaSettings
207+ val args = List (" -Wconf:cat=deprecation:e" , " -Wconf:cat=deprecation:s" )
208+ val sumy = ArgsSummary (sets.defaultState, args, errors = Nil , warnings = Nil )
209+ val proc = sets.processArguments(sumy, processAll = true , skipped = Nil )
210+ val conf = sets.Wconf .valueIn(proc.sstate)
211+ val msg = " Don't use that!" .toMessage
212+ val depr = new Diagnostic .DeprecationWarning (msg, util.NoSourcePosition )
213+ val sut = reporting.WConf .fromSettings(conf).getOrElse(??? )
214+ assertEquals(Action .Silent , sut.action(depr))
215+
216+
217+ >>>>>>> 16dd58f fix : Closes # 18367 `-Wconf` options are processed incorrectly
202218
203219end ScalaSettingsTests
0 commit comments