-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:named-tuplesIssues tied to the named tuples feature.Issues tied to the named tuples feature.itype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)
Description
Compiler version
3.7.2-RC1-bin-20250507-c85982c-NIGHTLY
Minimized code
Some((name = "Bob")) match {
case Some(name = a) => println(a)
}
Output
Compiles, but running the program gives:
Exception in thread "main" java.lang.ClassCastException: class scala.Tuple1 cannot be cast to class java.lang.String (scala.Tuple1 is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
at org.test.Main$package$.test(Main.scala:17)
at org.test.test.main(Main.scala:7)
Expectation
Should print 6
Metadata
Metadata
Assignees
Labels
area:named-tuplesIssues tied to the named tuples feature.Issues tied to the named tuples feature.itype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)