Skip to content

Commit 80f8c1b

Browse files
committed
ExplicitOuter: Scala2 inner modules always require outer pointer.
1 parent ffe77a4 commit 80f8c1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
117117
object ExplicitOuter {
118118
import ast.tpd._
119119

120-
private val LocalInstantiationSite = Module | Private
121-
122120
/** Ensure that class `cls` has outer accessors */
123121
def ensureOuterAccessors(cls: ClassSymbol)(implicit ctx: Context): Unit = {
124122
//todo: implementing #165 would simplify this logic
@@ -176,7 +174,8 @@ object ExplicitOuter {
176174

177175
/** Class is always instantiated in the compilation unit where it is defined */
178176
private def hasLocalInstantiation(cls: ClassSymbol)(implicit ctx: Context): Boolean =
179-
cls.owner.isTerm || cls.is(LocalInstantiationSite)
177+
// scala2x modules always take an outer pointer(as of 2.11)
178+
cls.owner.isTerm || cls.is(Private) || cls.is(Module, Scala2x)
180179

181180
/** The outer parameter accessor of cass `cls` */
182181
private def outerParamAccessor(cls: ClassSymbol)(implicit ctx: Context): TermSymbol =

0 commit comments

Comments
 (0)