Michal Lepíček
06/10/2024, 4:26 PMThe following declaration is incompatible because return type is different:
val name: String?
In module A, I have an interface with:
abstract val name: String?
In module B, there is a child class with
override val name: String = "SampleDestination"
Additionally, both modules contain actual classes with empty expect classes. This setup prevents successful compilation on both iOS and Android platforms.
This is a simple example, which is easily avoidable. However, there are more complicated cases that fail with the same error.
This code works on k1.
It also works if I keep all of it in one multiplatform module which is why I believe it to be a bug.streetsofboston
06/10/2024, 4:37 PMname
(from String?
to String
) in the base class B, which shouldn't be allowed. I think K2 is correctstreetsofboston
06/10/2024, 4:40 PMnull
to name
you'd have a problem: type A allows it but type B can't handle it.Michal Lepíček
06/10/2024, 4:41 PMMichal Lepíček
06/10/2024, 4:42 PMstreetsofboston
06/10/2024, 4:42 PMstreetsofboston
06/10/2024, 4:45 PMMichal Lepíček
06/10/2024, 4:47 PMMichal Lepíček
06/10/2024, 4:48 PMstreetsofboston
06/10/2024, 4:49 PMstreetsofboston
06/10/2024, 4:50 PMMichal Lepíček
06/10/2024, 4:51 PM