what happened |
It compiles, but when run throws a ClassCastException:
java.lang.ExceptionInInitializerError
at test.unapplyJoins.main(stripped5.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.ObjectRunner$$anonfun$0.apply(ObjectRunner.scala:75)
at scala.tools.nsc.ObjectRunner$.withContextClassLoader(ObjectRunner.scala:49)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:154)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassCastException: test.unapplyJoins$ cannot be cast to test.unapplyJoins$Buffer
at test.unapplyJoins$Buffer$$anonfun$0.isDefinedAt(stripped5.scala:16)
at test.unapplyJoins$.(stripped5.scala:20)
at test.unapplyJoins$.(stripped5.scala)
... 10 more
For method isDefinedAt of the jp PartialFunction the following (wrong) code is generated:
final def isDefinedAt(x$1: java.lang.Object): Boolean = if (unapplyJoins.this.$asInstanceOf[test.unapplyJoins$Bu\
ffer]().Get().unapply(x$1))
true
else
false;
|