https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

spand

02/25/2019, 1:53 PM
Is it possible to fulfill the companion object of something typealiased to a java type? ie.
Copy code
expect class Foo {
    companion object {
        fun of() : Foo
    }
}

actual typealias Foo = java.lang.String
It's in the docs
s

spand

02/25/2019, 2:13 PM
Where exactly?
a

addamsson

02/25/2019, 4:12 PM
what I linked is a single page
did you actually read it?
i

ilya.gorbunov

02/25/2019, 4:38 PM
@spand No, currently Java classes can't be actual for expect classes with companions, because they do not have companion objects. But we're exploring such possibility.
@addamsson The docs don't answer this particular question.
a

addamsson

02/25/2019, 4:41 PM
oh I see
mea culpa
s

spand

02/25/2019, 5:08 PM
Ok. Thanks for the reply!
3 Views