Would union types in Kotlin, instead of overloads ...
# announcements
c
Would union types in Kotlin, instead of overloads be possible in the future?
r
I believe #arrow-meta has done some work in that regard, but I doubt it will make it into the language itself.
n
You can emulate this with sealed classes, but this doesn't work well because you'd have to intrusively add inheritance to the types in question
There's a proposal to allow for interface inheritance to be added non intrusively, once that's available it would be possible to emulate this in a rather verbose but decent way