diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-03-01 09:26:50 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-03-02 16:22:27 -0800 |
commit | 534cadc762a5dc3a5d211ad3733df91c7b1bd931 (patch) | |
tree | 4c7d5d57b316806a76b5f6964a8c16f3e694ca35 /src/compiler | |
parent | a40af3e42fdfff62901dbc807ed3d899272d2b37 (diff) | |
download | scala-534cadc762a5dc3a5d211ad3733df91c7b1bd931.tar.gz scala-534cadc762a5dc3a5d211ad3733df91c7b1bd931.tar.bz2 scala-534cadc762a5dc3a5d211ad3733df91c7b1bd931.zip |
SI-5905 Restore -language:_
Underscore means all.
-x:c,b,a,_ results in value c,b,a,a,b,c,d,...
Currently, -Xprint does not present phases as a closed
set of choices; there is ad hoc checking in Global.
That would be a nice unification. (You don't know the
list of choices until after global is constructed.)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/MutableSettings.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala index c22dc564b2..54e444decf 100644 --- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala @@ -576,6 +576,7 @@ class MutableSettings(val errorFn: String => Unit) def tryToSet(args: List[String]) = { val (strings, rest) = args span (x => !x.startsWith("-")) strings foreach { + case "_" if choices.nonEmpty => choices foreach appendToValue case s if choices.isEmpty || (choices contains s) => appendToValue(s) case s => badChoice(s, name) } @@ -586,6 +587,8 @@ class MutableSettings(val errorFn: String => Unit) def clear(): Unit = (v = Nil) def unparse: List[String] = value map (name + ":" + _) + def contains(s: String) = value contains s + withHelpSyntax(name + ":<" + arg + ">") } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 1004777f23..14aa25eeb8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -738,7 +738,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper val featureName = (nestedOwners map (_.name + ".")).mkString + featureTrait.name def action(): Boolean = { def hasImport = inferImplicit(EmptyTree: Tree, featureTrait.tpe, reportAmbiguous = true, isView = false, context).isSuccess - def hasOption = settings.language.value exists (s => s == featureName || s == "_") + def hasOption = settings.language contains featureName val OK = hasImport || hasOption if (!OK) { val Some(AnnotationInfo(_, List(Literal(Constant(featureDesc: String)), Literal(Constant(required: Boolean))), _)) = |