New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassCastException from nested, parameterized value classes #6337
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6337?orig=1 |
@jsuereth said: |
@harrah said: object C {
def main(args: Array[String]) {
val x = new X(new XX(Some(3)))
println(x.i.x.get + 9)
}
}
class X[T](val i: XX[T]) extends AnyVal
class XX[T](val x: Option[T]) extends AnyVal The error is:
|
@harrah said: object C {
def main(args: Array[String]) {
val x = X(XX(3))
println(x.q.x.x + 9)
}
}
trait Q extends Any {
def x: Int
def inc: XX
}
case class X(val x: Q) extends AnyVal {
def q = X(x.inc)
}
case class XX(val x: Int) extends AnyVal with Q {
def inc = XX(x + 1)
}
|
@odersky said: |
Getting the value from nested, parameterized value classes throws ClassCastException at runtime.
The text was updated successfully, but these errors were encountered: