aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorliu fengyun <liu@fengy.me>2016-12-19 16:50:32 +0100
committerliu fengyun <liu@fengy.me>2016-12-19 16:50:32 +0100
commit1d534c54b5150868818609a2055fdc11e82643fe (patch)
tree8501744c228e06c0bacfbb49f139d1cf90541245 /compiler/src/dotty/tools/dotc/transform
parentbfabceeb1d19848e86f69019a4614c3653420ccc (diff)
downloaddotty-1d534c54b5150868818609a2055fdc11e82643fe.tar.gz
dotty-1d534c54b5150868818609a2055fdc11e82643fe.tar.bz2
dotty-1d534c54b5150868818609a2055fdc11e82643fe.zip
refine previous commit
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
index 007210926..16010d439 100644
--- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
@@ -79,8 +79,7 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
val isTrait = cls.is(Trait)
if (needsOuterIfReferenced(cls) &&
!needsOuterAlways(cls) &&
- (cls.mixins.exists(needsOuterIfReferenced) ||
- impl.existsSubTree(referencesOuter(cls, _))))
+ impl.existsSubTree(referencesOuter(cls, _)))
ensureOuterAccessors(cls)
val hasOuterFlag = hasOuter(cls)
@@ -187,6 +186,7 @@ object ExplicitOuter {
private def needsOuterAlways(cls: ClassSymbol)(implicit ctx: Context): Boolean =
needsOuterIfReferenced(cls) &&
(!hasLocalInstantiation(cls) || // needs outer because we might not know whether outer is referenced or not
+ cls.mixins.exists(needsOuterIfReferenced) || // needs outer for parent traits
cls.classInfo.parents.exists(parent => // needs outer to potentially pass along to parent
needsOuterIfReferenced(parent.classSymbol.asClass)))