@@ -49,8 +49,9 @@ object Contexts {
4949 private val (profilerLoc, store7) = store6.newLocation[Profiler ]()
5050 private val (notNullInfosLoc, store8) = store7.newLocation[List [NotNullInfo ]]()
5151 private val (importInfoLoc, store9) = store8.newLocation[ImportInfo ]()
52+ private val (typeAssignerLoc, store10) = store9.newLocation[TypeAssigner ](TypeAssigner )
5253
53- private val initialStore = store9
54+ private val initialStore = store10
5455
5556 /** The current context */
5657 inline def ctx (using ctx : Context ): Context = ctx
@@ -157,11 +158,6 @@ object Contexts {
157158 protected def typerState_= (typerState : TyperState ): Unit = _typerState = typerState
158159 final def typerState : TyperState = _typerState
159160
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-
165161 /** The current bounds in force for type parameters appearing in a GADT */
166162 private var _gadt : GadtConstraint = _
167163 protected def gadt_= (gadt : GadtConstraint ): Unit = _gadt = gadt
@@ -228,6 +224,9 @@ object Contexts {
228224 /** The currently active import info */
229225 def importInfo = store(importInfoLoc)
230226
227+ /** The current type assigner or typer */
228+ def typeAssigner : TypeAssigner = store(typeAssignerLoc)
229+
231230 /** The new implicit references that are introduced by this scope */
232231 protected var implicitsCache : ContextualImplicits = null
233232 def implicits : ContextualImplicits = {
@@ -483,7 +482,6 @@ object Contexts {
483482 _owner = origin.owner
484483 _tree = origin.tree
485484 _scope = origin.scope
486- _typeAssigner = origin.typeAssigner
487485 _gadt = origin.gadt
488486 _searchHistory = origin.searchHistory
489487 _source = origin.source
@@ -574,10 +572,6 @@ object Contexts {
574572 def setNewTyperState (): this .type = setTyperState(typerState.fresh().setCommittable(true ))
575573 def setExploreTyperState (): this .type = setTyperState(typerState.fresh().setCommittable(false ))
576574 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
581575 def setTyper (typer : Typer ): this .type = { this .scope = typer.scope; setTypeAssigner(typer) }
582576 def setGadt (gadt : GadtConstraint ): this .type =
583577 util.Stats .record(" Context.setGadt" )
@@ -615,6 +609,7 @@ object Contexts {
615609 def setProfiler (profiler : Profiler ): this .type = updateStore(profilerLoc, profiler)
616610 def setNotNullInfos (notNullInfos : List [NotNullInfo ]): this .type = updateStore(notNullInfosLoc, notNullInfos)
617611 def setImportInfo (importInfo : ImportInfo ): this .type = updateStore(importInfoLoc, importInfo)
612+ def setTypeAssigner (typeAssigner : TypeAssigner ): this .type = updateStore(typeAssignerLoc, typeAssigner)
618613
619614 def setProperty [T ](key : Key [T ], value : T ): this .type =
620615 setMoreProperties(moreProperties.updated(key, value))
@@ -742,7 +737,6 @@ object Contexts {
742737 typerState = TyperState .initialState()
743738 owner = NoSymbol
744739 tree = untpd.EmptyTree
745- typeAssigner = TypeAssigner
746740 moreProperties = Map (MessageLimiter -> DefaultMessageLimiter ())
747741 source = NoSource
748742 store = initialStore
0 commit comments