File tree 4 files changed +7
-7
lines changed 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ object PickleBuffer {
221
221
FINAL_PKL -> Final ,
222
222
METHOD_PKL -> Method ,
223
223
INTERFACE_PKL -> NoInitsInterface ,
224
- MODULE_PKL -> Module ,
224
+ MODULE_PKL -> ( Module | Lazy , Module ) ,
225
225
IMPLICIT_PKL -> Implicit ,
226
226
SEALED_PKL -> Sealed ,
227
227
CASE_PKL -> Case ,
Original file line number Diff line number Diff line change @@ -117,8 +117,6 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
117
117
object ExplicitOuter {
118
118
import ast .tpd ._
119
119
120
- private val LocalInstantiationSite = Module | Private
121
-
122
120
/** Ensure that class `cls` has outer accessors */
123
121
def ensureOuterAccessors (cls : ClassSymbol )(implicit ctx : Context ): Unit = {
124
122
// todo: implementing #165 would simplify this logic
@@ -176,7 +174,9 @@ object ExplicitOuter {
176
174
177
175
/** Class is always instantiated in the compilation unit where it is defined */
178
176
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
+ // dotty modules are always locally instantiated
179
+ cls.owner.isTerm || cls.is(Private ) || cls.is(Module , butNot = Scala2x )
180
180
181
181
/** The outer parameter accessor of cass `cls` */
182
182
private def outerParamAccessor (cls : ClassSymbol )(implicit ctx : Context ): TermSymbol =
Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
216
216
val rhs =
217
217
if (ctx.atPhase(thisTransform)(implicit ctx => getter.is(ParamAccessor ))) nextArgument()
218
218
else if (isScala2x)
219
- if (getter.is(Lazy )) lazyGetterCall
219
+ if (getter.is(Lazy , butNot = Module )) lazyGetterCall
220
+ else if (getter.is(Module ))
221
+ New (getter.info.resultType, List (This (cls)))
220
222
else Underscore (getter.info.resultType)
221
223
else transformFollowing(superRef(initializer(getter)).appliedToNone)
222
224
// transformFollowing call is needed to make memoize & lazy vals run
Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ import util.Stats.{track, record}
34
34
import config .Printers ._
35
35
import language .implicitConversions
36
36
37
- trait TyperContextOps { ctx : Context => }
38
-
39
37
object Typer {
40
38
41
39
/** The precedence of bindings which determines which of several bindings will be
You can’t perform that action at this time.
0 commit comments