@@ -5098,7 +5098,7 @@ object Types extends TypeUtils {
5098
5098
def underlying (using Context ): Type = bound
5099
5099
5100
5100
private var myReduced : Type | Null = null
5101
- private var reductionContext : util.MutableMap [Type , Type ] = uninitialized
5101
+ private var reductionContext : util.MutableMap [Type , Type ] | Null = null
5102
5102
5103
5103
override def tryNormalize (using Context ): Type =
5104
5104
try
@@ -5153,15 +5153,12 @@ object Types extends TypeUtils {
5153
5153
cases.foreach(traverse)
5154
5154
reductionContext = util.HashMap ()
5155
5155
for tp <- footprint do
5156
- reductionContext(tp) = contextInfo(tp)
5156
+ reductionContext.nn (tp) = contextInfo(tp)
5157
5157
matchTypes.println(i " footprint for $thisMatchType $hashCode: ${footprint.toList.map(x => (x, contextInfo(x)))}%, % " )
5158
5158
end setReductionContext
5159
5159
5160
5160
def changedReductionContext (): Boolean =
5161
- val isUpToDate =
5162
- (reductionContext ne null ) &&
5163
- reductionContext.keysIterator.forall: tp =>
5164
- reductionContext(tp) `eq` contextInfo(tp)
5161
+ val isUpToDate = reductionContext != null && reductionContext.nn.iterator.forall(contextInfo(_) `eq` _)
5165
5162
if ! isUpToDate then setReductionContext()
5166
5163
! isUpToDate
5167
5164
@@ -5193,10 +5190,9 @@ object Types extends TypeUtils {
5193
5190
5194
5191
/** True if the reduction uses GADT constraints. */
5195
5192
def reducesUsingGadt (using Context ): Boolean =
5196
- (reductionContext ne null ) && reductionContext.keysIterator.exists {
5197
- case tp : TypeRef => reductionContext(tp).exists
5198
- case _ => false
5199
- }
5193
+ reductionContext != null && reductionContext.nn.iterator.exists:
5194
+ case (tp : TypeRef , tpCtx) => tpCtx.exists
5195
+ case _ => false
5200
5196
5201
5197
override def computeHash (bs : Binders ): Int = doHash(bs, scrutinee, bound :: cases)
5202
5198
0 commit comments