Skip to content

Commit 1ec17f6

Browse files
normalize MatchAlias in unrollTupleTypes
1 parent 997103d commit 1ec17f6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/src/dotty/tools/dotc/inlines/Inlines.scala

+3
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ object Inlines:
441441
unrollTupleTypes(tail).map(head :: _)
442442
case tpe: TermRef if tpe.symbol == defn.EmptyTupleModule =>
443443
Some(Nil)
444+
case tpRef: TypeRef => tpRef.info match
445+
case MatchAlias(alias) => unrollTupleTypes(alias.tryNormalize)
446+
case _ => None
444447
case _ =>
445448
None
446449

tests/pos/i19385.scala

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import scala.compiletime.summonAll
2+
3+
inline def f[M <: Tuple]: Unit =
4+
type Alias = Tuple.Map[M, [X] =>> Numeric[X]]
5+
summonAll[Tuple.Map[M, [X] =>> Numeric[X]]] // compiles
6+
summonAll[Alias] // error: Tuple element types must be known at compile time
7+
8+
val y1 = f[(Int, Int)]

0 commit comments

Comments
 (0)