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 {
24552455 def apply (module : TermSymbol , modcls : ClassSymbol ): LazyType = this
24562456
24572457 private var myDecls : Scope = EmptyScope
2458+ private var mySourceModule : Symbol = null
2459+ private var myModuleClass : Symbol = null
24582460 private var mySourceModuleFn : Context ?=> Symbol = LazyType .NoSymbolFn
24592461 private var myModuleClassFn : Context ?=> Symbol = LazyType .NoSymbolFn
24602462
@@ -2464,8 +2466,12 @@ object SymDenotations {
24642466 else sym.info.typeParams
24652467
24662468 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
24692475
24702476 def withDecls (decls : Scope ): this .type = { myDecls = decls; this }
24712477 def withSourceModule (sourceModuleFn : Context ?=> Symbol ): this .type = { mySourceModuleFn = sourceModuleFn; this }
You can’t perform that action at this time.
0 commit comments