@@ -89,6 +89,7 @@ class ScalaSettingsTests:
89
89
val nowr = new Diagnostic .Warning (" This is a problem." .toMessage, util.NoSourcePosition )
90
90
assertEquals(Action .Silent , sut.action(nowr))
91
91
92
+ <<<<<<< lts- 3.3 - backport- 18503
92
93
@ Ignore (" LTS backport rejected: https://github.com/scala/scala3/pull/18503" )
93
94
@ Test def `i18367 rightmost WConf flags take precedence over flags to the left` : Unit =
94
95
import reporting .{Action , Diagnostic }
@@ -199,5 +200,20 @@ class ScalaSettingsTests:
199
200
)
200
201
)
201
202
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
202
218
203
219
end ScalaSettingsTests
0 commit comments