summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-14 10:41:51 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-17 20:26:08 +0200
commit4ed7a60caf3648571de9a120e095f9cf3a0151c4 (patch)
tree1fa74c1b7723c7d26d48e76d5eccf47da1ebff93 /src
parent10c9cf05b415e39a004fcf983117668db73f46e1 (diff)
downloadscala-4ed7a60caf3648571de9a120e095f9cf3a0151c4.tar.gz
scala-4ed7a60caf3648571de9a120e095f9cf3a0151c4.tar.bz2
scala-4ed7a60caf3648571de9a120e095f9cf3a0151c4.zip
Revert "Fix SI-4581."
This reverts commit 373f22a2022519ab894c1ea77460e6460d7c2ee4.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
index dff9a65649..68a9510407 100644
--- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala
+++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
@@ -550,10 +550,6 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
else tree
}
- case DefDef(mods, name, tps, vps, tp, rhs) if tree.symbol.hasStaticAnnotation =>
- reporter.error(tree.pos, "The @static annotation is not allowed on method definitions.")
- super.transform(tree)
-
case ValDef(mods, name, tpt, rhs) if tree.symbol.hasStaticAnnotation =>
def transformStaticValDef = {
log("moving @static valdef field: " + name + ", in: " + tree.symbol.owner)
@@ -596,8 +592,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
}
// create a static field in the companion class for this @static field
- val stfieldSym = linkedClass.newValue(newTermName(name), tree.pos, STATIC | SYNTHETIC | FINAL) setInfo sym.tpe
- if (sym.isMutable) stfieldSym.setFlag(MUTABLE)
+ val stfieldSym = linkedClass.newVariable(newTermName(name), tree.pos, STATIC | SYNTHETIC | FINAL) setInfo sym.tpe
stfieldSym.addAnnotation(StaticClass)
val names = classNames.getOrElseUpdate(linkedClass, linkedClass.info.decls.collect {
@@ -773,8 +768,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
staticSym <- clazz.info.decls
if staticSym.hasStaticAnnotation
} staticSym match {
- case stfieldSym if (stfieldSym.isValue && !stfieldSym.isMethod) || stfieldSym.isVariable =>
- log(stfieldSym + " is value: " + stfieldSym.isValue)
+ case stfieldSym if stfieldSym.isVariable =>
val valdef = staticBodies((clazz, stfieldSym))
val ValDef(_, _, _, rhs) = valdef
val fixedrhs = rhs.changeOwner((valdef.symbol, clazz.info.decl(nme.CONSTRUCTOR)))