summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-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]