Skip to content

Commit 10e53a8

Browse files
stripLazyRef for underlyingMatchType
Part of the changes needed to make `tryNormalize.exists ==> underlyingMatchType.exists` Also allows removing `override def tryNormalize` from `LazyRef`
1 parent 13781b1 commit 10e53a8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ object Types extends TypeUtils {
468468
/** Does this application expand to a match type? */
469469
def isMatchAlias(using Context): Boolean = underlyingMatchType.exists
470470

471-
def underlyingMatchType(using Context): Type = this.safeDealias match
471+
def underlyingMatchType(using Context): Type = this.safeDealias.stripLazyRef match
472472
case tp: MatchType => tp
473473
case tp: AppliedType => tp.underlyingMatchType
474474
case _ => NoType
@@ -3226,8 +3226,6 @@ object Types extends TypeUtils {
32263226
private var myRef: Type | Null = null
32273227
private var computed = false
32283228

3229-
override def tryNormalize(using Context): Type = ref.tryNormalize
3230-
32313229
def ref(using Context): Type =
32323230
if computed then
32333231
if myRef == null then

0 commit comments

Comments
 (0)