summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Rudolph <johannes_rudolph@gmx.de>2012-07-22 10:31:42 +0200
committerPaul Phillips <paulp@improving.org>2012-07-24 20:51:38 -0700
commit8abdfa48e4a03534ee981a52ec71fbd85a23d510 (patch)
treeb45ff25c14cd05525ca7d9f5252bd52d5997bb3e /src
parent6eb55d4b7ab804ba581157ed39df42ded885a12e (diff)
downloadscala-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
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala12
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]