Skip to content

Commit 2464a4d

Browse files
committed
Delete redundantly warning for list options
1 parent 18e53af commit 2464a4d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

compiler/src/dotty/tools/dotc/config/Settings.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,8 @@ object Settings:
257257
// check whether a value was previously set
258258
def checkRedundant(actual: List[String]) =
259259
if changed then
260-
var dangers: List[String] = Nil
261260
val current = valueIn(sstate).asInstanceOf[List[String]]
262-
for value <- split if current.contains(value) do
263-
dangers :+= s"Setting $name set to $value redundantly"
264-
dangers.foldLeft(update(current ++ actual, arg, args))((sum, w) => sum.warn(w))
261+
update(current ++ actual, arg, args)
265262
else
266263
update(actual, arg, args)
267264
choices match

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ScalaSettingsTests:
5858
assertTrue("Has the feature", set.contains("implicitConversions"))
5959
assertTrue("Has the feature", set.contains("dynamics"))
6060

61-
@Test def `Warn if multistring element is supplied multiply`: Unit =
61+
@Test def `Don't warn if multistring element is supplied multiply`: Unit =
6262
class SUT extends SettingGroup:
6363
val language: Setting[List[String]] = MultiStringSetting(RootSetting, "language", "feature", "Enable one or more language features.")
6464
val sut = SUT()
@@ -67,7 +67,7 @@ class ScalaSettingsTests:
6767
val res = sut.processArguments(sumy, processAll = true, skipped = Nil)
6868
val set = sut.language.valueIn(res.sstate)
6969
assertEquals(3, args.length)
70-
assertEquals("Must warn", 1, res.warnings.length)
70+
assertTrue("Mustn't warn", res.warnings.isEmpty)
7171
assertTrue("No errors!", res.errors.isEmpty)
7272
assertTrue("Has the feature", set.contains("implicitConversions"))
7373
assertTrue("Has the feature", set.contains("dynamics"))

0 commit comments

Comments
 (0)