-
Notifications
You must be signed in to change notification settings - Fork 1.1k
java.lang.VerifyError: Bad type on operand stack #12557
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
Comments
#11208 same issue? 🤔 |
I just experienced something similar on 3.3.3. In my case, we have a server endpoint which returns some standard fields along with a legacy deprecated field. We instantiate an object and Jackson converts it into JSON. To blend the standard & deprecated fields, we're using a trick where they are separate classes. Here's a simplified example: case class InspectionDto(id: UUID, targetId: UUID)
trait DeprecatedInspectionFields {
val fileId: UUID
} This pattern has some benefits in our corporate codebase. With Jackson, the resulting JSON produced by our API would successfully include the good + obsolete fields if we instantiated an anonymous class like this: new InspectionDto(inspectionId, targetId) with DeprecatedInspectionFields {
override val fileId = targetId
} This worked well in 2.12 and 2.13, but in 3.3.3 at runtime we observed this:
That final line number (167) is where we're instantiating this value, specifically the final close-brace of the anonymous class. The problem would not arise if we stop using this anonymous class trick for the deprecated fields, and instead just instantiated a concrete class. But the interesting thing is that it could be fixed in another way, which retains the In the original code, we have a By moving the |
Compiler version
3.0.1-RC1-bin-20210521-de319fb-NIGHTLY
and3.0.0
Minimized code
Output
Expectation
The text was updated successfully, but these errors were encountered: