Skip to content

Commit 0cded65

Browse files
committed
Move delias into recur for tupleElementTypesUpTo
1 parent 5b869a4 commit 0cded65

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/TypeUtils.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class TypeUtils:
6868
def tupleElementTypesUpTo(bound: Int, normalize: Boolean = true)(using Context): Option[List[Type]] =
6969
def recur(tp: Type, bound: Int): Option[List[Type]] =
7070
if bound < 0 then Some(Nil)
71-
else (if normalize then tp.normalized else tp).dealias match
71+
else (if normalize then tp.dealias.normalized else tp).dealias match
7272
case AppliedType(tycon, hd :: tl :: Nil) if tycon.isRef(defn.PairClass) =>
7373
recur(tl, bound - 1).map(hd :: _)
7474
case tp: AppliedType if defn.isTupleNType(tp) && normalize =>
@@ -83,8 +83,7 @@ class TypeUtils:
8383
case _ =>
8484
if defn.isTupleClass(tp.typeSymbol) && !normalize then Some(tp.dealias.argInfos)
8585
else None
86-
val stripped = if normalize then self.stripTypeVar.dealias else self.stripTypeVar // keep error reporting aliased
87-
recur(stripped, bound)
86+
recur(self.stripTypeVar, bound)
8887

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

0 commit comments

Comments
 (0)