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
Under -Ydelambdafy:method, an anonymous function returning a value class will erroneously be translated to an anonymous function returning the underlying type of that value class, instead of its boxed representation, resulting in ClassCastException at runtime.
During posterasure, the knowledge that the result type was a value class, here StringOps (and not a String) is lost. I think posterasure should perform a boxing operation, here (or erasure itself).
If the lambda takes a value class instead instead, then the compiler crashes during icode because some ErasedValueType(class StringOps, String) survive until then.
I suspect that both errors have the same cause, namely that posterasure fails to deal with value classes in Function nodes. Hence I report the two in only one issue.
Note that both snippets work perfectly fine with -Ydelambdafy:inline (the default).
The text was updated successfully, but these errors were encountered:
Under -Ydelambdafy:method, an anonymous function returning a value class will erroneously be translated to an anonymous function returning the underlying type of that value class, instead of its boxed representation, resulting in ClassCastException at runtime.
During
posterasure
, the knowledge that the result type was a value class, here StringOps (and not a String) is lost. I thinkposterasure
should perform a boxing operation, here (orerasure
itself).After erasure:
After posterasure:
If the lambda takes a value class instead instead, then the compiler crashes during
icode
because some ErasedValueType(class StringOps, String) survive until then.After erasure:
After posterasure:
I suspect that both errors have the same cause, namely that posterasure fails to deal with value classes in Function nodes. Hence I report the two in only one issue.
Note that both snippets work perfectly fine with -Ydelambdafy:inline (the default).
The text was updated successfully, but these errors were encountered: