Hi, guys! I have, for example, 'expect fun test() ...
# announcements
p
Hi, guys! I have, for example, 'expect fun test() : Unit' and i want specify default actual for it, so in case there is no actual for any platform this implementation should be substituted. Does Kotlin have such possibility?
h
You could implement the function and do an ordinary override, perhaps?
p
@hallvard Sorry, I don't understand your answer. Could you be so kind to write some example?
h
I mean, maybe you could implement the function in the common module, and then, in the different platform modules, you would have
override fun test(): Unit { ... }
? That would give you a default fallback behaviour.
r
That won't work with top level functions.