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) {
32613261 // then TypeComparer will eventually start returning `false` for `isSubType`.
32623262 // Or, under -Yno-deep-subtypes, start throwing AssertionErrors.
32633263 // So, we eagerly strip that lazy ref here to avoid the stacking.
3264- tp.stripLazyRef. simplified
3264+ tp.simplified
32653265 case Nil =>
32663266 val casesText = MatchTypeTrace .noMatchesText(scrut, cases)
32673267 ErrorType (reporting.MatchTypeNoCases (casesText))
Original file line number Diff line number Diff line change @@ -1984,7 +1984,11 @@ object Types {
19841984 * this method handles this by never simplifying inside a `MethodicType`,
19851985 * except for replacing type parameters with associated type variables.
19861986 */
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 )
19881992
19891993 /** Compare `this == that`, assuming corresponding binders in `bs` are equal.
19901994 * The normal `equals` should be equivalent to `equals(that, null`)`.
You can’t perform that action at this time.
0 commit comments