Skip to content

Commit 1d534c5

Browse files
committed
refine previous commit
1 parent bfabcee commit 1d534c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
7979
val isTrait = cls.is(Trait)
8080
if (needsOuterIfReferenced(cls) &&
8181
!needsOuterAlways(cls) &&
82-
(cls.mixins.exists(needsOuterIfReferenced) ||
83-
impl.existsSubTree(referencesOuter(cls, _))))
82+
impl.existsSubTree(referencesOuter(cls, _)))
8483
ensureOuterAccessors(cls)
8584

8685
val hasOuterFlag = hasOuter(cls)
@@ -187,6 +186,7 @@ object ExplicitOuter {
187186
private def needsOuterAlways(cls: ClassSymbol)(implicit ctx: Context): Boolean =
188187
needsOuterIfReferenced(cls) &&
189188
(!hasLocalInstantiation(cls) || // needs outer because we might not know whether outer is referenced or not
189+
cls.mixins.exists(needsOuterIfReferenced) || // needs outer for parent traits
190190
cls.classInfo.parents.exists(parent => // needs outer to potentially pass along to parent
191191
needsOuterIfReferenced(parent.classSymbol.asClass)))
192192

0 commit comments

Comments
 (0)