I observe some behavior that is different from wha...
# multiplatform
c
I observe some behavior that is different from what is documented here (rather I think the docs are missing one case):
Copy code
interface Foo {
    companion object {
        val x = "SomeValue"
    }
}
When the companion object is inside an interface then I don't see
Foo.Companion
or
Foo.companion.shared
. Instead, the companion object is created at the top level, so the usage is:
FooCompanion.shared
In fact this is not restricted to companion objects. It also applies to any inner classes of an interface. One notable example is `sealed interface`s.
Copy code
sealed class Action {
    data object OnCtaClicked: Action()
    data class OnItemSelected(val index: Int): Action()
}

//Swift
Action.OnCtaClicked()
Action.OnItemSelected(index: 2)
versus interface:
Copy code
sealed interface Action {
    data object OnCtaClicked: Action
    data class OnItemSelected(val index: Int): Action
}

//Swift:
ActionOnCtaClicked()
ActionOnItemSelected(index: 2)