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
{{ message }}
Repository navigation
[generator] Implement Kotlin interfaces and open classes with value-class parameters #13669
When a Kotlin interface or open class method has a value-class parameter or return type, kotlinc mangles its JVM name:
interfaceColorCallback {
funonDp(dp:MyDp): Int // JVM name: onDp-<hash>(F)I
}
C# can call these methods, but cannot implement or override them, because the Java callable wrapper (JCW) must declare the method with the mangled Java name. This blocks Compose callbacks and modifiers that C# code would implement.
Expected: a C# class that implements IColorCallback (or overrides the open class method) produces a JCW method with the mangled name and signature, and Java calls reach the C# implementation with the value-class struct.
Steps to Reproduce
Bind a Kotlin library with the interface above (the ColorCallback fixture in tests/Xamarin.Android.Tools.Bytecode-Tests/kotlin-gradle has one).
Implement IColorCallback in C# and pass it to Kotlin code that calls onDp.
The JCW does not declare onDp-<hash>, so the Java call does not reach the C# method.
Activity
[generator] Marshal Kotlin value classes across JNI (#13581)