@@ -49,8 +49,9 @@ object Contexts {
49
49
private val (profilerLoc, store7) = store6.newLocation[Profiler ]()
50
50
private val (notNullInfosLoc, store8) = store7.newLocation[List [NotNullInfo ]]()
51
51
private val (importInfoLoc, store9) = store8.newLocation[ImportInfo ]()
52
+ private val (typeAssignerLoc, store10) = store9.newLocation[TypeAssigner ](TypeAssigner )
52
53
53
- private val initialStore = store9
54
+ private val initialStore = store10
54
55
55
56
/** The current context */
56
57
inline def ctx (using ctx : Context ): Context = ctx
@@ -157,11 +158,6 @@ object Contexts {
157
158
protected def typerState_= (typerState : TyperState ): Unit = _typerState = typerState
158
159
final def typerState : TyperState = _typerState
159
160
160
- /** The current type assigner or typer */
161
- private var _typeAssigner : TypeAssigner = _
162
- protected def typeAssigner_= (typeAssigner : TypeAssigner ): Unit = _typeAssigner = typeAssigner
163
- final def typeAssigner : TypeAssigner = _typeAssigner
164
-
165
161
/** The current bounds in force for type parameters appearing in a GADT */
166
162
private var _gadt : GadtConstraint = _
167
163
protected def gadt_= (gadt : GadtConstraint ): Unit = _gadt = gadt
@@ -228,6 +224,9 @@ object Contexts {
228
224
/** The currently active import info */
229
225
def importInfo = store(importInfoLoc)
230
226
227
+ /** The current type assigner or typer */
228
+ def typeAssigner : TypeAssigner = store(typeAssignerLoc)
229
+
231
230
/** The new implicit references that are introduced by this scope */
232
231
protected var implicitsCache : ContextualImplicits = null
233
232
def implicits : ContextualImplicits = {
@@ -483,7 +482,6 @@ object Contexts {
483
482
_owner = origin.owner
484
483
_tree = origin.tree
485
484
_scope = origin.scope
486
- _typeAssigner = origin.typeAssigner
487
485
_gadt = origin.gadt
488
486
_searchHistory = origin.searchHistory
489
487
_source = origin.source
@@ -574,10 +572,6 @@ object Contexts {
574
572
def setNewTyperState (): this .type = setTyperState(typerState.fresh().setCommittable(true ))
575
573
def setExploreTyperState (): this .type = setTyperState(typerState.fresh().setCommittable(false ))
576
574
def setReporter (reporter : Reporter ): this .type = setTyperState(typerState.fresh().setReporter(reporter))
577
- def setTypeAssigner (typeAssigner : TypeAssigner ): this .type =
578
- util.Stats .record(" Context.setTypeAssigner" )
579
- this .typeAssigner = typeAssigner
580
- this
581
575
def setTyper (typer : Typer ): this .type = { this .scope = typer.scope; setTypeAssigner(typer) }
582
576
def setGadt (gadt : GadtConstraint ): this .type =
583
577
util.Stats .record(" Context.setGadt" )
@@ -615,6 +609,7 @@ object Contexts {
615
609
def setProfiler (profiler : Profiler ): this .type = updateStore(profilerLoc, profiler)
616
610
def setNotNullInfos (notNullInfos : List [NotNullInfo ]): this .type = updateStore(notNullInfosLoc, notNullInfos)
617
611
def setImportInfo (importInfo : ImportInfo ): this .type = updateStore(importInfoLoc, importInfo)
612
+ def setTypeAssigner (typeAssigner : TypeAssigner ): this .type = updateStore(typeAssignerLoc, typeAssigner)
618
613
619
614
def setProperty [T ](key : Key [T ], value : T ): this .type =
620
615
setMoreProperties(moreProperties.updated(key, value))
@@ -741,7 +736,6 @@ object Contexts {
741
736
typerState = TyperState .initialState()
742
737
owner = NoSymbol
743
738
tree = untpd.EmptyTree
744
- typeAssigner = TypeAssigner
745
739
moreProperties = Map (MessageLimiter -> DefaultMessageLimiter ())
746
740
source = NoSource
747
741
store = initialStore
0 commit comments