Would union types in Kotlin, instead of overloads be possible in the future?
r
Ruckus
12/25/2020, 1:53 AM
I believe #CJ699L62W has done some work in that regard, but I doubt it will make it into the language itself.
n
Nir
12/25/2020, 4:38 PM
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
Nir
12/25/2020, 4:39 PM
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