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
hallvard
02/14/2019, 8:43 AM
You could implement the function and do an ordinary override, perhaps?
p
PHondogo
02/14/2019, 9:45 AM
@hallvard Sorry, I don't understand your answer. Could you be so kind to write some example?
h
hallvard
02/14/2019, 9:48 AM
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.