Skip to content

Commit

Permalink
Merge pull request #1180 from niktrop/dotc-settings-format
Browse files Browse the repository at this point in the history
dotc settings: String options after settings with colon shouldn't be ignored
  • Loading branch information
DarkDimius committed Mar 22, 2016
2 parents 552a56a + 5ff8649 commit 3e43c7f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dotty/tools/dotc/config/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,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
Expand Down

2 comments on commit 3e43c7f

@niktrop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DarkDimius
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.