File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2455,6 +2455,8 @@ object SymDenotations {
2455
2455
def apply (module : TermSymbol , modcls : ClassSymbol ): LazyType = this
2456
2456
2457
2457
private var myDecls : Scope = EmptyScope
2458
+ private var mySourceModule : Symbol = null
2459
+ private var myModuleClass : Symbol = null
2458
2460
private var mySourceModuleFn : Context ?=> Symbol = LazyType .NoSymbolFn
2459
2461
private var myModuleClassFn : Context ?=> Symbol = LazyType .NoSymbolFn
2460
2462
@@ -2464,8 +2466,12 @@ object SymDenotations {
2464
2466
else sym.info.typeParams
2465
2467
2466
2468
def decls : Scope = myDecls
2467
- def sourceModule (using Context ): Symbol = mySourceModuleFn
2468
- def moduleClass (using Context ): Symbol = myModuleClassFn
2469
+ def sourceModule (using Context ): Symbol =
2470
+ if mySourceModule == null then mySourceModule = mySourceModuleFn
2471
+ mySourceModule
2472
+ def moduleClass (using Context ): Symbol =
2473
+ if myModuleClass == null then myModuleClass = myModuleClassFn
2474
+ myModuleClass
2469
2475
2470
2476
def withDecls (decls : Scope ): this .type = { myDecls = decls; this }
2471
2477
def withSourceModule (sourceModuleFn : Context ?=> Symbol ): this .type = { mySourceModuleFn = sourceModuleFn; this }
You can’t perform that action at this time.
0 commit comments