summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-08-10 15:57:43 +0000
committerMartin Odersky <odersky@gmail.com>2010-08-10 15:57:43 +0000
commit9d7586adab61fc4c8868b901361433f1dfc62d56 (patch)
treee09b758d933f7d4a1363b0c4ecbb6fb5af76e680 /src
parent1e68079614a9a7c6acbae13c7709cd6ec8f1be35 (diff)
downloadscala-9d7586adab61fc4c8868b901361433f1dfc62d56.tar.gz
scala-9d7586adab61fc4c8868b901361433f1dfc62d56.tar.bz2
scala-9d7586adab61fc4c8868b901361433f1dfc62d56.zip
Fixes #3728. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Definitions.scala1
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala5
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala24
3 files changed, 19 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
index 667bdd5386..198c225e8b 100644
--- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
@@ -448,6 +448,7 @@ trait Definitions extends reflect.generic.StandardDefinitions {
lazy val DeprecatedAttr: Symbol = getClass("scala.deprecated")
lazy val DeprecatedNameAttr: Symbol = getClass("scala.deprecatedName")
lazy val MigrationAnnotationClass: Symbol = getClass("scala.annotation.migration")
+ lazy val TraitSetterAnnotationClass: Symbol = getClass("scala.runtime.TraitSetter")
lazy val BeanPropertyAttr: Symbol = getClass(sn.BeanProperty)
lazy val BooleanBeanPropertyAttr: Symbol = getClass(sn.BooleanBeanProperty)
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 8c2f79374c..28ff336f60 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -259,7 +259,8 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
def classSigSuffix: String =
"."+sym.name
if (sym == ArrayClass)
- ARRAY_TAG.toString+(args map jsig).mkString
+ if (unboundedGenericArrayLevel(tp) == 1) jsig(ObjectClass.tpe)
+ else ARRAY_TAG.toString+(args map jsig).mkString
else if (sym.isTypeParameterOrSkolem &&
// only refer to type params that will actually make it into the sig, this excludes:
!sym.owner.isTypeParameterOrSkolem && // higher-order type parameters (!sym.owner.isTypeParameterOrSkolem), and parameters of methods
@@ -1088,4 +1089,4 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
}
}
}
-} \ No newline at end of file
+}
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index d1b3142c8a..a9922a50f2 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -475,16 +475,22 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
if (!currentOwner.isTrait) addMixedinMembers(currentOwner,unit)
else if (currentOwner hasFlag lateINTERFACE) addLateInterfaceMembers(currentOwner)
tree
- case DefDef(mods, name, tparams, List(vparams), tpt, rhs) if currentOwner.isImplClass =>
- if (isImplementedStatically(sym)) {
- sym setFlag notOVERRIDE
- self = sym.newValue(sym.pos, nme.SELF)
- .setFlag(PARAM)
- .setInfo(toInterface(currentOwner.typeOfThis));
- val selfdef = ValDef(self) setType NoType
- treeCopy.DefDef(tree, mods, name, tparams, List(selfdef :: vparams), tpt, rhs)
+ case DefDef(mods, name, tparams, List(vparams), tpt, rhs) =>
+ if (currentOwner.isImplClass) {
+ if (isImplementedStatically(sym)) {
+ sym setFlag notOVERRIDE
+ self = sym.newValue(sym.pos, nme.SELF)
+ .setFlag(PARAM)
+ .setInfo(toInterface(currentOwner.typeOfThis));
+ val selfdef = ValDef(self) setType NoType
+ treeCopy.DefDef(tree, mods, name, tparams, List(selfdef :: vparams), tpt, rhs)
+ } else {
+ EmptyTree
+ }
} else {
- EmptyTree
+ if (currentOwner.isTrait && sym.isSetter)
+ sym.addAnnotation(AnnotationInfo(TraitSetterAnnotationClass.tpe, List(), List()))
+ tree
}
case Apply(tapp @ TypeApply(fn, List(arg)), List()) =>
if (arg.tpe.typeSymbol.isImplClass) {