-
Notifications
You must be signed in to change notification settings - Fork 406
Closed
Labels
bugConfirmed bug. Needs to be fixed.Confirmed bug. Needs to be fixed.
Milestone
Description
The deserialization hack for the argument of a Throw node coming from Scala.js 1.11 produces invalid IR in Scala.js 1.18. It generates an UnwrapFromThrowable operation with a nullable argument (actually, literally Null()). But in 1.18 UnwrapFromThrowable is a UnaryOp that demands a non-nullable argument.
The error reads:
...(UnaryOp): java.lang.Throwable! expected but null found for tree of type org.scalajs.ir.Trees$Null
There were 1 IR checking errors.
This does not happen for throw new ... because it special-cases those away. However it happens for throw e where e is a variable or a more complicated expression.
Discovered by @plokhotnyuk on Discord.
A reproduction with the javalib, which we can use in our BackwardsCompatTest, is the following expression:
java.util.Base64.getDecoder().decode(java.nio.ByteBuffer.wrap(Array(65, 81, 73, 61)))because Base64.Decoder.decode(ByteBuffer) contains such a throw e.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed bug. Needs to be fixed.Confirmed bug. Needs to be fixed.