diff options
author | Martin Odersky <odersky@gmail.com> | 2011-05-11 12:40:23 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-05-11 12:40:23 +0000 |
commit | 1e1c4d05dba31aed11edfd25e9350ab48ce2cd3e (patch) | |
tree | 0bde04d8dcb063aac82a17912c83e93187c3ee21 | |
parent | 106a3ac9a7f74cc89541ffe3cf6b084db65bedd1 (diff) | |
download | scala-1e1c4d05dba31aed11edfd25e9350ab48ce2cd3e.tar.gz scala-1e1c4d05dba31aed11edfd25e9350ab48ce2cd3e.tar.bz2 scala-1e1c4d05dba31aed11edfd25e9350ab48ce2cd3e.zip |
Further narrowing down the applicability of Hub...
Further narrowing down the applicability of Hubert's patch, to reduce
the risk we break something else. Review by dragos. Review by plocinic.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index ac4f19f69d..943b0e2644 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -892,8 +892,11 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { case DefDef(mods, name, tp, vp, tpt, rhs) if sym.isModule && (!clazz.isTrait || clazz.isImplClass) && !sym.hasFlag(BRIDGE) => val attrThis = - if (clazz.isImplClass) gen.mkAttributedIdent(vp.head.head.symbol) - else gen.mkAttributedThis(clazz) + if (clazz.isImplClass && !isImplementedStatically(sym)) + gen.mkAttributedIdent(vp.head.head.symbol) + //!!! I think this can be replaced by selfRef(tree.pos) + else + gen.mkAttributedThis(clazz) val rhs1 = mkInnerClassAccessorDoubleChecked(attrThis, rhs) treeCopy.DefDef(stat, mods, name, tp, vp, tpt, typedPos(stat.pos)(rhs1)) case _ => stat |