Skip to content

Commit a324d12

Browse files
committed
Normalize tuple types in synthetized classOf instances
1 parent 979c546 commit a324d12

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Synthesizer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
5353
if defn.SpecialClassTagClasses.contains(sym) then
5454
classTagModul.select(sym.name.toTermName).withSpan(span)
5555
else
56-
val ctype = escapeJavaArray(erasure(tp))
56+
val ctype = escapeJavaArray(erasure(tp.normalizedTupleType))
5757
if ctype.exists then
5858
classTagModul.select(nme.apply)
5959
.appliedToType(tp)

tests/run/i22345c.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def makeSeq[T](args: T*): Seq[T] = args
2+
3+
@main def Test: Unit =
4+
val a: Array[(Int, String)] = makeSeq[Int *: String *: EmptyTuple]().toArray

0 commit comments

Comments
 (0)