@@ -5123,11 +5123,6 @@ object Types extends TypeUtils {
5123
5123
tp.underlying
5124
5124
}
5125
5125
5126
- def isUpToDate : Boolean =
5127
- (reductionContext ne null ) &&
5128
- reductionContext.keysIterator.forall: tp =>
5129
- reductionContext(tp) `eq` contextInfo(tp)
5130
-
5131
5126
def setReductionContext (): Unit =
5132
5127
new TypeTraverser :
5133
5128
var footprint : Set [Type ] = Set ()
@@ -5162,15 +5157,22 @@ object Types extends TypeUtils {
5162
5157
matchTypes.println(i " footprint for $thisMatchType $hashCode: ${footprint.toList.map(x => (x, contextInfo(x)))}%, % " )
5163
5158
end setReductionContext
5164
5159
5160
+ def changedReductionContext (): Boolean =
5161
+ val isUpToDate =
5162
+ (reductionContext ne null ) &&
5163
+ reductionContext.keysIterator.forall: tp =>
5164
+ reductionContext(tp) `eq` contextInfo(tp)
5165
+ if ! isUpToDate then setReductionContext()
5166
+ ! isUpToDate
5167
+
5165
5168
record(" MatchType.reduce called" )
5166
5169
if ! Config .cacheMatchReduced
5167
5170
|| myReduced == null
5168
- || ! isUpToDate
5171
+ || changedReductionContext()
5169
5172
|| MatchTypeTrace .isRecording
5170
5173
then
5171
5174
record(" MatchType.reduce computed" )
5172
5175
if (myReduced != null ) record(" MatchType.reduce cache miss" )
5173
- if ! isUpToDate then setReductionContext()
5174
5176
val saved = ctx.typerState.snapshot()
5175
5177
try
5176
5178
myReduced = trace(i " reduce match type $this $hashCode" , matchTypes, show = true ):
0 commit comments