Potential ClassCastException when pattern matching case class within generic trait #11130
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
patmat
runtime crash
Milestone
Using Scala 2.12.6, the following code crashes with a ClassCastException:
The exception occurs when trying to print the matched value
v
.By removing the
Group
wrapper object, the code works as expected. It seems that the extra wrapper object makes the compiler skip checking the$outer
reference that is present in the inner case class.This bug is related to #9639 and Test1 in #6583. #9639 is still reported as open, but it seems to be fixed in Scala 2.12.6.
The text was updated successfully, but these errors were encountered: