SrSouza

    SrSouza

    8 months ago
    Hi folks, there is anyway to have
    expect interface
    with a
    expect val property: String
    that should be defined with
    actual get() =
    ? The currently interface I want to move to multiplatform looks something like this:
    interface Screen : Serializable {
      val key: String
         get() = this::class.qualiedName ?: error()
    }
    So it was
    Serializable
    , I'm expect/actual for the JVM version to have Serializable (Android need it), and the key I'm not able to use expect/actual.
    Trevor Stone

    Trevor Stone

    8 months ago
    Why not just have the interface as-is in common and then make platform specific Impl with the additional interfaces you need on the impl
    SrSouza

    SrSouza

    8 months ago
    I found a solution, I'm not able to set the property as
    expect
    but it by default, and it also is
    abstract
    by default, so I add a
    open
    modifier and I was able to use
    actual
    on JVM