Another odd one I'm finding in testing - `Screen...
# k2-early-adopters
z
Another odd one I'm finding in testing •
Screen
is an expect/actual interface that, on
androidMain
, extends android's
Parcelable
interface •
AndroidScreen
is a regular interface in an android library project that extends
Screen
OpenUrlScreen
is an
actual
class in
androidMain
that implements both and leverages the
@Parcelize
plugin
Copy code
@Parcelize
actual data class OpenUrlScreen actual constructor(actual val url: String) : Screen, AndroidScreen
At a glance, it seems that the parcelize plugin is generating bytecode that doesn't name the parameter, and because it doesn't match what Kotlin expects from the metadata (which indicates they're a named param), it falls over. However, the original declaration is in java, so why would it matter?
Copy code
public void writeToParcel(@NonNull Parcel dest, @WriteFlags int flags);
Let me know if I should file a bug for this (and where, as I know Google maintains this plugin but I'm not sure if this is bug with the compiler or parcelize)
actually it seems to not matter if there's an intermediary
AndroidScreen
, happens with just this too
Copy code
@Parcelize
actual data class OpenUrlScreen actual constructor(actual val url: String) : Screen
d
Please report to Kotlin tracker
👍 1
z