diff options
author | Martin Odersky <odersky@gmail.com> | 2010-08-18 17:47:04 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-08-18 17:47:04 +0000 |
commit | 86d07ffe729e8666a71b4382d764462a8620b9bc (patch) | |
tree | d5884cadcbd21d4166a2040f5724a3d5c5f43f22 | |
parent | 4fb0d53f1c59c7b6ad0f2c79ac1b0c555e4cef91 (diff) | |
download | scala-86d07ffe729e8666a71b4382d764462a8620b9bc.tar.gz scala-86d07ffe729e8666a71b4382d764462a8620b9bc.tar.bz2 scala-86d07ffe729e8666a71b4382d764462a8620b9bc.zip |
Closes #3763. No review.
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 7a28fd0538..131b0d0a03 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -176,6 +176,10 @@ self => */ var classContextBounds: List[Tree] = Nil + /** Are we inside the Scala package? Set for files that start with package scala + */ + private var inScalaPackage = false + def parseStartRule: () => Tree /** This is the general parse entry point. @@ -2443,7 +2447,7 @@ self => (List(), List(List()), self, body) } var parents = parents0 - if (name != nme.ScalaObject.toTypeName && !isInterface(mods, body)) + if (!isInterface(mods, body) && !(inScalaPackage && name == nme.Array.toTypeName)) parents = parents ::: List(scalaScalaObjectConstr) if (parents.isEmpty) parents = List(scalaAnyRefConstr) @@ -2712,6 +2716,8 @@ self => } } else { in.flushDoc + if (in.token == IDENTIFIER && in.name.encode == nme.scala_) + inScalaPackage = true val pkg = qualId() newLineOptWhenFollowedBy(LBRACE) if (in.token == EOF) { diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 547d3cc096..92c92796cf 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -489,7 +489,6 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { } } else { if (currentOwner.isTrait && sym.isSetter && !atPhase(currentRun.picklerPhase)(sym.isDeferred)) { - println("add TraitSetter to "+sym) sym.addAnnotation(AnnotationInfo(TraitSetterAnnotationClass.tpe, List(), List())) } tree |