diff options
author | Johannes Rudolph <johannes_rudolph@gmx.de> | 2012-07-22 10:31:42 +0200 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-07-24 20:51:38 -0700 |
commit | 8abdfa48e4a03534ee981a52ec71fbd85a23d510 (patch) | |
tree | b45ff25c14cd05525ca7d9f5252bd52d5997bb3e | |
parent | 6eb55d4b7ab804ba581157ed39df42ded885a12e (diff) | |
download | scala-8abdfa48e4a03534ee981a52ec71fbd85a23d510.tar.gz scala-8abdfa48e4a03534ee981a52ec71fbd85a23d510.tar.bz2 scala-8abdfa48e4a03534ee981a52ec71fbd85a23d510.zip |
Revert fix part of "Closes 4560. Review by dragos."
This reverts commit 7127d8293775905acd0d04e21d9e045b5c029261.
Conflicts:
test/files/run/t4560.scala
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index e672f1914a..72dc47adbc 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -65,14 +65,14 @@ abstract class CleanUp extends Transform with ast.TreeDSL { * the enclosing implementation class instead. */ def safeREF(sym: Symbol) = { - def fix(tree: Tree): Unit = tree match { - case Select(qual @ This(_), name) if qual.symbol != currentClass => - qual.setSymbol(currentClass).setType(currentClass.tpe) - case _ => + def fix(tree: Tree): Tree = tree match { + case Select(qual, name) => treeCopy.Select(tree, fix(qual), name) + case This(_) if tree.symbol.isInterface && tree.symbol.name + "$class" == currentClass.name.toString => + tree.setSymbol(currentClass).setType(currentClass.tpe) + case _ => tree } val tree = REF(sym) - if (currentClass.isImplClass && sym.owner == currentClass) fix(tree) - tree + if (currentClass.isImplClass) fix(tree) else tree } //private val classConstantMeth = new HashMap[String, Symbol] |