Skip to content

Commit 5ff8649

Browse files
committed
String options with choices should be followed by colon and argument without whitespace
Format of some of the compiler settings was incompatible with scalac. For example "-target:jvm-1.8" is a valid argument for scalac, but it should be "-target: jvm-1.8" (with a whitespace) for dotc.
1 parent 16f0bea commit 5ff8649

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ object Settings {
115115
case (ListTag, _) =>
116116
if (argRest.isEmpty) missingArg
117117
else update((argRest split ",").toList, args)
118+
case (StringTag, _) if choices.nonEmpty =>
119+
if (argRest.isEmpty) missingArg
120+
else if (!choices.contains(argRest))
121+
fail(s"$arg is not a valid choice for $name", args)
122+
else update(argRest, args)
118123
case (StringTag, arg2 :: args2) =>
119-
if (choices.nonEmpty && !(choices contains arg2))
120-
fail(s"$arg2 is not a valid choice for $name", args2)
121-
else
122-
update(arg2, args2)
124+
update(arg2, args2)
123125
case (IntTag, arg2 :: args2) =>
124126
try {
125127
val x = arg2.toInt

0 commit comments

Comments
 (0)