diff options
author | Nikolay.Tropin <Nikolay.Tropin@jetbrains.com> | 2016-03-18 17:24:33 +0300 |
---|---|---|
committer | Nikolay.Tropin <Nikolay.Tropin@jetbrains.com> | 2016-03-18 17:24:33 +0300 |
commit | 5ff8649b1bf36c1fcd55ba2ec71c93c4c587af81 (patch) | |
tree | dd54d9f521da9bb19a30f52bb71432730103cce0 /src | |
parent | 16f0bea7e4169ab89eddf2e7bae1de08ded3c84b (diff) | |
download | dotty-5ff8649b1bf36c1fcd55ba2ec71c93c4c587af81.tar.gz dotty-5ff8649b1bf36c1fcd55ba2ec71c93c4c587af81.tar.bz2 dotty-5ff8649b1bf36c1fcd55ba2ec71c93c4c587af81.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/config/Settings.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/config/Settings.scala b/src/dotty/tools/dotc/config/Settings.scala index 73bb056aa..c45289c4c 100644 --- a/src/dotty/tools/dotc/config/Settings.scala +++ b/src/dotty/tools/dotc/config/Settings.scala @@ -115,11 +115,13 @@ object Settings { case (ListTag, _) => if (argRest.isEmpty) missingArg else update((argRest split ",").toList, args) + case (StringTag, _) if choices.nonEmpty => + if (argRest.isEmpty) missingArg + else if (!choices.contains(argRest)) + fail(s"$arg is not a valid choice for $name", args) + else update(argRest, args) case (StringTag, arg2 :: args2) => - if (choices.nonEmpty && !(choices contains arg2)) - fail(s"$arg2 is not a valid choice for $name", args2) - else - update(arg2, args2) + update(arg2, args2) case (IntTag, arg2 :: args2) => try { val x = arg2.toInt |