Is there a limitation with using expect/actual for...
# multiplatform
m
Is there a limitation with using expect/actual for default function implementations in sealed interfaces? I get:
Copy code
// commonMain
expect sealed interface Foo {
    fun toUri(): Uri
}

// androidMain
actual sealed interface Foo {
    actual fun toUri(): Uri { // error: Actual function 'toUri' has no corresponding expected declaration
        TODO()
    }
}
c
I think you just do not need the actual keyword before the
toUri
function, since your
Foo
sealed interface is what is marked with
expect
m
Then it complains that:
Declaration must be marked with 'actual'
Seems to work fine if I just use a sealed class instead
👍 1
The discussion here is quite relevant: https://youtrack.jetbrains.com/issue/KT-22841