From 6eec16fab36f0cfbb9ba225ecdb5b45629452e77 Mon Sep 17 00:00:00 2001 From: Eugene Flesselle Date: Mon, 29 Jan 2024 21:07:29 +0100 Subject: [PATCH] normalize MatchAlias in unrollTupleTypes --- compiler/src/dotty/tools/dotc/inlines/Inlines.scala | 3 +++ tests/pos/i19385.scala | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/pos/i19385.scala diff --git a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala index 4860913bdc63..c6906a0dbf0a 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala @@ -443,6 +443,9 @@ object Inlines: unrollTupleTypes(tail).map(head :: _) case tpe: TermRef if tpe.symbol == defn.EmptyTupleModule => Some(Nil) + case tpRef: TypeRef => tpRef.info match + case MatchAlias(alias) => unrollTupleTypes(alias.tryNormalize) + case _ => None case _ => None diff --git a/tests/pos/i19385.scala b/tests/pos/i19385.scala new file mode 100644 index 000000000000..0f66a15c13bc --- /dev/null +++ b/tests/pos/i19385.scala @@ -0,0 +1,8 @@ +import scala.compiletime.summonAll + +inline def f[M <: Tuple]: Unit = + type Alias = Tuple.Map[M, [X] =>> Numeric[X]] + summonAll[Tuple.Map[M, [X] =>> Numeric[X]]] // compiles + summonAll[Alias] // error: Tuple element types must be known at compile time + +val y1 = f[(Int, Int)] \ No newline at end of file