Hi! In our MPP we have a sealed class that looks l...
# multiplatform
d
Hi! In our MPP we have a sealed class that looks like this:
Copy code
sealed class OptionalProperty<out T> {
    object NotPresent : OptionalProperty<Nothing>()
    data class Present<T>(val value: T) : OptionalProperty<T>()
}
that is used as a type for other properties, e.g.
data class Holder(val maybeThere: OptionalProperty<String>)
. When trying to reference the
NotPresent
object or instantiating it (if we let it be a class and not an object) from swift we get an error saying
Cannot convert return expression of type 'OptionalProperty<KotlinNothing>' to return type 'OptionalProperty<NSString>'
. Instantiating
OptionalProperty.Present
works fine. So my question is; Are sealed classes even supported/usable in native? If so, how can we use it? What are we doing wrong?