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
You can find a reproducer project here where one can compile with Scala 2.13.6, 3.0.2 and 3.1.0-RC2 and see the difference in bytecode between versions.
Output
$> javap ByNameParam.class
Compiled from "ByNameParam.scala"
public final class ByNameParam {
public static void byNameParam(scala.Function0);
}
Expectation
This is the output of the same class when compiling against Scala 2.13.6. $> javap ByNameParam.class
Compiled from "ByNameParam.scala"
public final class ByNameParam {
public static void byNameParam(scala.Function0<java.lang.String>);
}
Please note the missing type parameter String on Function0.
Impact
Java interoperability will be affected by this bug as the String type is completely lost.
The text was updated successfully, but these errors were encountered:
When a method has
by-name
parameters its type it's erased in the generated bytecode.Compiler version
3.0.2
and3.1.0-RC2
Minimized code
You can find a reproducer project here where one can compile with Scala 2.13.6, 3.0.2 and 3.1.0-RC2 and see the difference in bytecode between versions.
Output
$> javap ByNameParam.class
Expectation
This is the output of the same class when compiling against Scala 2.13.6.
$> javap ByNameParam.class
Please note the missing type parameter
String
onFunction0
.Impact
Java interoperability will be affected by this bug as the String type is completely lost.
The text was updated successfully, but these errors were encountered: