@@ -14,7 +14,7 @@ import Uniques._
1414import ast .Trees ._
1515import ast .untpd
1616import Flags .GivenOrImplicit
17- import util .{FreshNameCreator , NoSource , SimpleIdentityMap , SourceFile }
17+ import util .{NoSource , SimpleIdentityMap , SourceFile }
1818import typer .{Implicits , ImportInfo , Inliner , NamerContextOps , SearchHistory , SearchRoot , TypeAssigner , Typer , Nullables }
1919import Nullables .{NotNullInfo , given }
2020import Implicits .ContextualImplicits
@@ -44,12 +44,11 @@ object Contexts {
4444 private val (sbtCallbackLoc, store2) = store1.newLocation[AnalysisCallback ]()
4545 private val (printerFnLoc, store3) = store2.newLocation[Context => Printer ](new RefinedPrinter (_))
4646 private val (settingsStateLoc, store4) = store3.newLocation[SettingsState ]()
47- private val (freshNamesLoc, store5) = store4.newLocation[FreshNameCreator ](new FreshNameCreator .Default )
48- private val (compilationUnitLoc, store6) = store5.newLocation[CompilationUnit ]()
49- private val (runLoc, store7) = store6.newLocation[Run ]()
50- private val (profilerLoc, store8) = store7.newLocation[Profiler ]()
51- private val (notNullInfosLoc, store9) = store8.newLocation[List [NotNullInfo ]]()
52- private val initialStore = store9
47+ private val (compilationUnitLoc, store5) = store4.newLocation[CompilationUnit ]()
48+ private val (runLoc, store6) = store5.newLocation[Run ]()
49+ private val (profilerLoc, store7) = store6.newLocation[Profiler ]()
50+ private val (notNullInfosLoc, store8) = store7.newLocation[List [NotNullInfo ]]()
51+ private val initialStore = store8
5352
5453 /** The current context */
5554 def curCtx (given ctx : Context ): Context = ctx
@@ -200,9 +199,6 @@ object Contexts {
200199 /** The current settings values */
201200 def settingsState : SettingsState = store(settingsStateLoc)
202201
203- /** The current fresh name creator */
204- def freshNames : FreshNameCreator = store(freshNamesLoc)
205-
206202 /** The current compilation unit */
207203 def compilationUnit : CompilationUnit = store(compilationUnitLoc)
208204
@@ -474,6 +470,8 @@ object Contexts {
474470 if (prev != null ) prev
475471 else {
476472 val newCtx = fresh.setSource(source)
473+ if (newCtx.compilationUnit == null )
474+ newCtx.setCompilationUnit(CompilationUnit (source))
477475 sourceCtx = sourceCtx.updated(source, newCtx)
478476 newCtx
479477 }
@@ -566,7 +564,6 @@ object Contexts {
566564 def setSettings (settingsState : SettingsState ): this .type = updateStore(settingsStateLoc, settingsState)
567565 def setRun (run : Run ): this .type = updateStore(runLoc, run)
568566 def setProfiler (profiler : Profiler ): this .type = updateStore(profilerLoc, profiler)
569- def setFreshNames (freshNames : FreshNameCreator ): this .type = updateStore(freshNamesLoc, freshNames)
570567 def setNotNullInfos (notNullInfos : List [NotNullInfo ]): this .type = updateStore(notNullInfosLoc, notNullInfos)
571568
572569 def setProperty [T ](key : Key [T ], value : T ): this .type =
0 commit comments