summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala1
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala10
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala16
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
-rw-r--r--test/files/run/constrained-types.scala1
5 files changed, 13 insertions, 24 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index ff45801767..c1373c59d4 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -110,7 +110,6 @@ class Settings(error: String => Unit) {
val Xexperimental = BooleanSetting ("-Xexperimental", "Enable experimental extensions")
val Xnojline = new BooleanSetting("-Xnojline", "Do not use JLine for editing").hideToIDE
val nouescape = BooleanSetting ("-Xno-uescape", "Disables handling of \\u unicode escapes")
- val Xplugtypes = BooleanSetting ("-Xplug-types", "Process annotations on types")
val plugin = MultiStringSetting("-Xplugin", "file", "Load a plugin from a file")
val disable = MultiStringSetting("-Xplugin-disable", "plugin", "Disable a plugin")
val showPlugins = BooleanSetting ("-Xplugin-list", "Print a synopsis of loaded plugins").hideToIDE
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index a04461a568..9b37ec8d02 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1593,12 +1593,10 @@ trait Parsers extends NewScanners with MarkupParsers {
*/
def typeAttributes(): List[Tree] = {
val exps = new ListBuffer[Tree]
- if (settings.Xplugtypes.value) {
- while(inToken == LBRACKET) {
- accept(LBRACKET)
- exps ++= exprs()
- accept(RBRACKET)
- }
+ while(inToken == LBRACKET) {
+ accept(LBRACKET)
+ exps ++= exprs()
+ accept(RBRACKET)
}
exps.toList
}
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
index 46c0e82d9c..5fdd2ac7a2 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
@@ -277,17 +277,11 @@ abstract class UnPickler {
val selfsym = if (tag == ANNOTATEDWSELFtpe) readSymbolRef()
else NoSymbol
val attribs = until(end, readTreeAttribRef)
- if(settings.Xplugtypes.value) {
- if (settings.selfInAnnots.value || (selfsym eq NoSymbol))
- AnnotatedType(attribs, tp, selfsym)
- else
- tp // drop annotations with a self symbol unless
- // -Yself-in-annots is on
- } else
- tp // Drop the annotations unless -Xplug-types is on.
- // This way, people can distribute classfiles
- // including annotated types without them much
- // affecting those who disable -Xplug-types
+ if (settings.selfInAnnots.value || (selfsym eq NoSymbol))
+ AnnotatedType(attribs, tp, selfsym)
+ else
+ tp // drop annotations with a self symbol unless
+ // -Yself-in-annots is on
case DEBRUIJNINDEXtpe =>
DeBruijnIndex(readNat(), readNat())
case _ =>
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index dd8618e0ae..7429c9ccf7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1840,8 +1840,7 @@ trait Typers { self: Analyzer =>
val annType = tpt.tpe
val needsConstant =
- (!settings.Xplugtypes.value ||
- (annType.typeSymbol isNonBottomSubClass ClassfileAnnotationClass))
+ (annType.typeSymbol isNonBottomSubClass ClassfileAnnotationClass)
def annotArg(tree: Tree): AnnotationArgument = {
val arg = new AnnotationArgument(tree)
@@ -2139,10 +2138,10 @@ trait Typers { self: Analyzer =>
atype0 // do not record selfsym if
// this annotation did not need it
- if (settings.Xplugtypes.value && !ainfo.isErroneous)
- TypeTree(atype) setOriginal tree
+ if (ainfo.isErroneous)
+ arg1 // simply drop erroneous annotations
else
- arg1
+ TypeTree(atype) setOriginal tree
} else {
def annotTypeTree(ainfo: AnnotationInfo): Tree =
TypeTree(arg1.tpe.withAttribute(ainfo)) setOriginal tree
diff --git a/test/files/run/constrained-types.scala b/test/files/run/constrained-types.scala
index 9a6d31cf6d..b640db1d67 100644
--- a/test/files/run/constrained-types.scala
+++ b/test/files/run/constrained-types.scala
@@ -87,7 +87,6 @@ object Test {
def main(args: Array[String]) {
val settings = new Settings
- settings.Xplugtypes.value = true
settings.Xexperimental.value = true
settings.selfInAnnots.value = true