Skip to content

Commit ba5021a

Browse files
mboveltgodzik
authored andcommitted
Normalize tuple types in synthetized classOf instances
[Cherry-picked a324d12]
1 parent 8b91ea8 commit ba5021a

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
@@ -51,7 +51,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
5151
if defn.SpecialClassTagClasses.contains(sym) then
5252
classTagModul.select(sym.name.toTermName).withSpan(span)
5353
else
54-
val ctype = escapeJavaArray(erasure(tp))
54+
val ctype = escapeJavaArray(erasure(tp.normalizedTupleType))
5555
if ctype.exists then
5656
classTagModul.select(nme.apply)
5757
.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)