Skip to content

Commit d1931aa

Browse files
Cache myReduced = NoType if match type reduction overflowed
1 parent 2176fe4 commit d1931aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5173,17 +5173,17 @@ object Types extends TypeUtils {
51735173
trace(i"reduce match type $this $hashCode", matchTypes, show = true):
51745174
withMode(Mode.Type):
51755175
setReductionContext()
5176-
def matchCases(cmp: MatchReducer): Type =
5176+
TypeComparer.reduceMatchWith: cmp =>
51775177
val saved = ctx.typerState.snapshot()
51785178
try
5179-
cmp.matchCases(scrutinee.normalized, cases.map(MatchTypeCaseSpec.analyze(_)))
5179+
cmp.matchCases(scrutinee.normalized, cases.map(MatchTypeCaseSpec.analyze))
51805180
catch case ex: Throwable =>
5181+
myReduced = NoType
51815182
handleRecursive("reduce type ", i"$scrutinee match ...", ex)
51825183
finally
51835184
ctx.typerState.resetTo(saved)
51845185
// this drops caseLambdas in constraint and undoes any typevar
51855186
// instantiations during matchtype reduction
5186-
TypeComparer.reduceMatchWith(matchCases)
51875187

51885188
//else println(i"no change for $this $hashCode / $myReduced")
51895189
myReduced.nn

0 commit comments

Comments
 (0)