Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline tryNormalize with underlyingMatchType #20268

Merged
merged 10 commits into from
Jul 5, 2024
Prev Previous commit
Next Next commit
stripLazyRef for underlyingNormalizable
  • Loading branch information
EugeneFlesselle committed Jun 28, 2024
commit 4fbba66ec6376e2d7f4f936cf79738fa86a49f23
4 changes: 1 addition & 3 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
@@ -491,7 +491,7 @@ object Types extends TypeUtils {
/** Does this application expand to a match type? */
def isMatchAlias(using Context): Boolean = underlyingNormalizable.isMatch

def underlyingNormalizable(using Context): Type = stripped match
def underlyingNormalizable(using Context): Type = stripped.stripLazyRef match
case tp: MatchType => tp
case tp: AppliedType => tp.underlyingNormalizable
case _ => NoType
@@ -3257,8 +3257,6 @@ object Types extends TypeUtils {
private var myRef: Type | Null = null
private var computed = false

override def tryNormalize(using Context): Type = ref.tryNormalize

def ref(using Context): Type =
if computed then
if myRef == null then