You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectBug {
classC(pf: PartialFunction[Any, Any])
caseclassD() extendsC({ case e => e })
defmain(args: Array[String]) {
D() // VerifyError
}
}
Here is the exception trace:
java.lang.VerifyError: (class:Bug$D, method: <init> signature: ()V) Expecting to find object/array on stack
at Bug$.main(Bug.scala:5)
at Bug.main(Bug.scala)
The cause of the bug is that D's <init> passes this to the constructor of the anonymous subclass of PartialFunction before the <init> method of the superclass C is invoked.
The following code results in a VerifyError:
Here is the exception trace:
The cause of the bug is that
D
's<init>
passesthis
to the constructor of the anonymous subclass ofPartialFunction
before the<init>
method of the superclassC
is invoked.Here is the bytecode for
D()
:The VerifyError occurs at the
invokespecial
at instruction 6, caused by theaload_0
at instruction 5.Note that the PartialFunction does not refer to
this
, so passing it in is unnecessary.The text was updated successfully, but these errors were encountered: