Skip to content

Commit 594b07c

Browse files
aherlihytgodzik
authored andcommitted
Move delias into recur for tupleElementTypesUpTo
[Cherry-picked 0cded65]
1 parent f674f80 commit 594b07c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class TypeUtils:
6060
def tupleElementTypesUpTo(bound: Int, normalize: Boolean = true)(using Context): Option[List[Type]] =
6161
def recur(tp: Type, bound: Int): Option[List[Type]] =
6262
if bound < 0 then Some(Nil)
63-
else (if normalize then tp.normalized else tp).dealias match
63+
else (if normalize then tp.dealias.normalized else tp).dealias match
6464
case AppliedType(tycon, hd :: tl :: Nil) if tycon.isRef(defn.PairClass) =>
6565
recur(tl, bound - 1).map(hd :: _)
6666
case tp: AppliedType if defn.isTupleNType(tp) && normalize =>
@@ -71,8 +71,7 @@ class TypeUtils:
7171
case _ =>
7272
if defn.isTupleClass(tp.typeSymbol) && !normalize then Some(tp.dealias.argInfos)
7373
else None
74-
val stripped = if normalize then self.stripTypeVar.dealias else self.stripTypeVar // keep error reporting aliased
75-
recur(stripped, bound)
74+
recur(self.stripTypeVar, bound)
7675

7776
/** Is this a generic tuple but not already an instance of one of Tuple1..22? */
7877
def isGenericTuple(using Context): Boolean =

0 commit comments

Comments
 (0)