@@ -48,7 +48,9 @@ object Contexts {
48
48
private val (runLoc, store6) = store5.newLocation[Run ]()
49
49
private val (profilerLoc, store7) = store6.newLocation[Profiler ]()
50
50
private val (notNullInfosLoc, store8) = store7.newLocation[List [NotNullInfo ]]()
51
- private val initialStore = store8
51
+ private val (importInfoLoc, store9) = store8.newLocation[ImportInfo ]()
52
+
53
+ private val initialStore = store9
52
54
53
55
/** The current context */
54
56
inline def ctx (using ctx : Context ): Context = ctx
@@ -156,11 +158,6 @@ object Contexts {
156
158
protected def typeAssigner_= (typeAssigner : TypeAssigner ): Unit = _typeAssigner = typeAssigner
157
159
final def typeAssigner : TypeAssigner = _typeAssigner
158
160
159
- /** The currently active import info */
160
- private var _importInfo : ImportInfo = _
161
- protected def importInfo_= (importInfo : ImportInfo ): Unit = _importInfo = importInfo
162
- final def importInfo : ImportInfo = _importInfo
163
-
164
161
/** The current bounds in force for type parameters appearing in a GADT */
165
162
private var _gadt : GadtConstraint = _
166
163
protected def gadt_= (gadt : GadtConstraint ): Unit = _gadt = gadt
@@ -230,6 +227,9 @@ object Contexts {
230
227
/** The paths currently known to be not null */
231
228
def notNullInfos = store(notNullInfosLoc)
232
229
230
+ /** The currently active import info */
231
+ def importInfo = store(importInfoLoc)
232
+
233
233
/** The new implicit references that are introduced by this scope */
234
234
protected var implicitsCache : ContextualImplicits = null
235
235
def implicits : ContextualImplicits = {
@@ -351,7 +351,9 @@ object Contexts {
351
351
352
352
/** Is this a context that introduces an import clause? */
353
353
def isImportContext : Boolean =
354
- (this ne NoContext ) && (this .importInfo ne outer.importInfo)
354
+ (this ne NoContext )
355
+ && (outer ne NoContext )
356
+ && (this .importInfo ne outer.importInfo)
355
357
356
358
/** Is this a context that introduces a non-empty scope? */
357
359
def isNonEmptyScopeContext : Boolean =
@@ -461,7 +463,6 @@ object Contexts {
461
463
_scope = origin.scope
462
464
_typerState = origin.typerState
463
465
_typeAssigner = origin.typeAssigner
464
- _importInfo = origin.importInfo
465
466
_gadt = origin.gadt
466
467
_searchHistory = origin.searchHistory
467
468
_typeComparer = origin.typeComparer
@@ -550,7 +551,6 @@ object Contexts {
550
551
def setReporter (reporter : Reporter ): this .type = setTyperState(typerState.fresh().setReporter(reporter))
551
552
def setTypeAssigner (typeAssigner : TypeAssigner ): this .type = { this .typeAssigner = typeAssigner; this }
552
553
def setTyper (typer : Typer ): this .type = { this .scope = typer.scope; setTypeAssigner(typer) }
553
- def setImportInfo (importInfo : ImportInfo ): this .type = { this .importInfo = importInfo; this }
554
554
def setGadt (gadt : GadtConstraint ): this .type = { this .gadt = gadt; this }
555
555
def setFreshGADTBounds : this .type = setGadt(gadt.fresh)
556
556
def setSearchHistory (searchHistory : SearchHistory ): this .type = { this .searchHistory = searchHistory; this }
@@ -572,6 +572,7 @@ object Contexts {
572
572
def setRun (run : Run ): this .type = updateStore(runLoc, run)
573
573
def setProfiler (profiler : Profiler ): this .type = updateStore(profilerLoc, profiler)
574
574
def setNotNullInfos (notNullInfos : List [NotNullInfo ]): this .type = updateStore(notNullInfosLoc, notNullInfos)
575
+ def setImportInfo (importInfo : ImportInfo ): this .type = updateStore(importInfoLoc, importInfo)
575
576
576
577
def setProperty [T ](key : Key [T ], value : T ): this .type =
577
578
setMoreProperties(moreProperties.updated(key, value))
0 commit comments