@@ -45,23 +45,19 @@ import scala.util.chaining.given
45
45
46
46
object Contexts :
47
47
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
65
61
66
62
/** The current context */
67
63
inline def ctx (using ctx : Context ): Context = ctx
0 commit comments