Skip to content

Commit ce7e7c8

Browse files
committed
Revert store
1 parent 6f09911 commit ce7e7c8

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

+13-17
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,19 @@ import scala.util.chaining.given
4545

4646
object Contexts:
4747

48-
private var _initialStore = Store.empty
49-
private def newLocation[A]() = { val (loc, s) = _initialStore.newLocation[A]() ; _initialStore = s ; loc }
50-
private def newLocation[A](a: A) = { val (loc, s) = _initialStore.newLocation[A](a) ; _initialStore = s ; loc }
51-
52-
private val compilerCallbackLoc = newLocation[CompilerCallback]()
53-
private val sbtCallbackLoc = newLocation[AnalysisCallback]()
54-
private val printerFnLoc = newLocation[Context => Printer](new RefinedPrinter(_))
55-
private val settingsStateLoc = newLocation[SettingsState]()
56-
private val compilationUnitLoc = newLocation[CompilationUnit]()
57-
private val runLoc = newLocation[Run]()
58-
private val profilerLoc = newLocation[Profiler]()
59-
private val notNullInfosLoc = newLocation[List[NotNullInfo]]()
60-
private val importInfoLoc = newLocation[ImportInfo]()
61-
private val typeAssignerLoc = newLocation[TypeAssigner](TypeAssigner)
62-
private val usagesLoc = newLocation[Usages](Usages())
63-
64-
private val initialStore = _initialStore
48+
private val (compilerCallbackLoc, store1) = Store.empty.newLocation[CompilerCallback]()
49+
private val (sbtCallbackLoc, store2) = store1.newLocation[AnalysisCallback]()
50+
private val (printerFnLoc, store3) = store2.newLocation[Context => Printer](new RefinedPrinter(_))
51+
private val (settingsStateLoc, store4) = store3.newLocation[SettingsState]()
52+
private val (compilationUnitLoc, store5) = store4.newLocation[CompilationUnit]()
53+
private val (runLoc, store6) = store5.newLocation[Run]()
54+
private val (profilerLoc, store7) = store6.newLocation[Profiler]()
55+
private val (notNullInfosLoc, store8) = store7.newLocation[List[NotNullInfo]]()
56+
private val (importInfoLoc, store9) = store8.newLocation[ImportInfo]()
57+
private val (typeAssignerLoc, store10) = store9.newLocation[TypeAssigner](TypeAssigner)
58+
private val (usagesLoc, store11) = store10.newLocation[Usages](Usages())
59+
60+
private val initialStore = store11
6561

6662
/** The current context */
6763
inline def ctx(using ctx: Context): Context = ctx

0 commit comments

Comments
 (0)