Is there a way to make only some functions in a cl...
# multiplatform
s
Is there a way to make only some functions in a class platform-specific? The following gives me an error that
baz
must be abstract since it has no body:
Copy code
class Foo {
    fun bar() { ... }
    expect fun baz(): Boolean
}
d
Sadly no.
k
Well, extension function
☝🏼 2
Copy code
class Foo {
    fun bar() { ... }
}
expect fun Foo.baz():Boolean
s
Oh, great. That’s just what I need. Thanks Kevin
👍 1