Skip to content

Commit 3e43c7f

Browse files
committed
Merge pull request #1180 from niktrop/dotc-settings-format
dotc settings: String options after settings with colon shouldn't be ignored
2 parents 552a56a + 5ff8649 commit 3e43c7f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ object Settings {
119119
case (ListTag, _) =>
120120
if (argRest.isEmpty) missingArg
121121
else update((argRest split ",").toList, args)
122+
case (StringTag, _) if choices.nonEmpty =>
123+
if (argRest.isEmpty) missingArg
124+
else if (!choices.contains(argRest))
125+
fail(s"$arg is not a valid choice for $name", args)
126+
else update(argRest, args)
122127
case (StringTag, arg2 :: args2) =>
123-
if (choices.nonEmpty && !(choices contains arg2))
124-
fail(s"$arg2 is not a valid choice for $name", args2)
125-
else
126-
update(arg2, args2)
128+
update(arg2, args2)
127129
case (IntTag, arg2 :: args2) =>
128130
try {
129131
val x = arg2.toInt

0 commit comments

Comments
 (0)