diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-10-21 17:23:00 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-10-21 17:23:00 +0200 |
commit | 7867f8cc9ff70f0e78acbd8af54f64a073a94f53 (patch) | |
tree | b801c3db65b987670dd821b112c9e03b29e1e297 /src/dotty/tools/dotc/transform/ExplicitOuter.scala | |
parent | dc1f711e1a362cf0ae7d15e8d19a2ccae7c80946 (diff) | |
download | dotty-7867f8cc9ff70f0e78acbd8af54f64a073a94f53.tar.gz dotty-7867f8cc9ff70f0e78acbd8af54f64a073a94f53.tar.bz2 dotty-7867f8cc9ff70f0e78acbd8af54f64a073a94f53.zip |
ExplicitOuter: fix generation of outer methods for indirectly inherited traits.
Diffstat (limited to 'src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/ExplicitOuter.scala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/src/dotty/tools/dotc/transform/ExplicitOuter.scala index 3e839326e..7391f3cec 100644 --- a/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -84,14 +84,19 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf newDefs += ValDef(outerParamAcc, EmptyTree) newDefs += DefDef(outerAccessor(cls).asTerm, ref(outerParamAcc)) } + + for (parentTrait <- cls.mixins) { + if (needsOuterIfReferenced(parentTrait)) { + val parentTp = cls.denot.thisType.baseTypeRef(parentTrait) + val outerAccImpl = newOuterAccessor(cls, parentTrait).enteredAfter(thisTransformer) + newDefs += DefDef(outerAccImpl, singleton(outerPrefix(parentTp))) + } + } + val parents1 = for (parent <- impl.parents) yield { val parentCls = parent.tpe.classSymbol.asClass if (parentCls.is(Trait)) { - if (needsOuterIfReferenced(parentCls)) { - val outerAccImpl = newOuterAccessor(cls, parentCls).enteredAfter(thisTransformer) - newDefs += DefDef(outerAccImpl, singleton(outerPrefix(parent.tpe))) - } parent } else parent match { // ensure class parent is a constructor |