From 5ff8649b1bf36c1fcd55ba2ec71c93c4c587af81 Mon Sep 17 00:00:00 2001 From: "Nikolay.Tropin" Date: Fri, 18 Mar 2016 17:24:33 +0300 Subject: 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. --- src/dotty/tools/dotc/config/Settings.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3