Skip to content

Array of tuples throws ClassCastException #22345

Open
@Quafadas

Description

@Quafadas

Compiler version

3.6.3-RC1

Minimized code

val a: Array[(Int, String)] = Array[Int *: String *: EmptyTuple]()

yoshord (<- discord handle, not sure of GitHub handle, apologies) suggest it to be reported after a brief discussion on discord.

https://discord.com/channels/632150470000902164/875868146949554207/1327170970942836777

Here is his Scastie reducing it, although the code above is even terser;

https://scastie.scala-lang.org/EsHwgPChRJqC9Ichpwq4gQ

Output

java.lang.ClassCastException: class [Lscala.Product; cannot be cast to class [Lscala.Tuple2;

Expectation

That this should compile and run.

Metadata

Metadata

Assignees

Labels

area:tuplesitype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions