-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:transformitype:bugstat:unassignedThis issue or PR is not assigned to anyone, but should beThis issue or PR is not assigned to anyone, but should be
Description
Compiler version
v3.1.1-RC2
Minimized code
https://scastie.scala-lang.org/l6Js266rRd2FuA4p0SkJLA
class Foo(val value : Int) extends AnyVal
class Container extends reflect.Selectable
val cont = new Container:
val foo = new Foo(1)
println(cont.foo.value) //ClassCastException
Output
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class Playground$Foo (java.lang.Integer is in module java.base of loader 'bootstrap'; Playground$Foo is in unnamed module of loader sbt.internal.BottomClassLoader @433c2ab9)
at Playground$.<clinit>(main.scala:8)
at Main$.<clinit>(main.scala:12)
at Main.main(main.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at sbt.Run.invokeMain(Run.scala:133)
at sbt.Run.execute$1(Run.scala:82)
at sbt.Run.$anonfun$runWithLoader$5(Run.scala:110)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:17)
at sbt.TrapExit$App.run(TrapExit.scala:258)
at java.base/java.lang.Thread.run(Thread.java:831)
Expectation
No error.
Metadata
Metadata
Assignees
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:transformitype:bugstat:unassignedThis issue or PR is not assigned to anyone, but should beThis issue or PR is not assigned to anyone, but should be