File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3261,7 +3261,7 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
3261
3261
// then TypeComparer will eventually start returning `false` for `isSubType`.
3262
3262
// Or, under -Yno-deep-subtypes, start throwing AssertionErrors.
3263
3263
// So, we eagerly strip that lazy ref here to avoid the stacking.
3264
- tp.stripLazyRef. simplified
3264
+ tp.simplified
3265
3265
case Nil =>
3266
3266
val casesText = MatchTypeTrace .noMatchesText(scrut, cases)
3267
3267
ErrorType (reporting.MatchTypeNoCases (casesText))
Original file line number Diff line number Diff line change @@ -1984,7 +1984,11 @@ object Types {
1984
1984
* this method handles this by never simplifying inside a `MethodicType`,
1985
1985
* except for replacing type parameters with associated type variables.
1986
1986
*/
1987
- def simplified (using Context ): Type = TypeOps .simplify(this , null )
1987
+ def simplified (using Context ): Type =
1988
+ // stripping LazyRef is important for the reduction of applied match types
1989
+ // see the comment in matchCases/recur for more details
1990
+ val tp = stripLazyRef
1991
+ TypeOps .simplify(tp, null )
1988
1992
1989
1993
/** Compare `this == that`, assuming corresponding binders in `bs` are equal.
1990
1994
* The normal `equals` should be equivalent to `equals(that, null`)`.
You can’t perform that action at this time.
0 commit comments