https://kotlinlang.org logo
Title
n

Nicole

03/10/2019, 8:09 PM
I think the answer is no, but is there anything like a Union for Kotlin outside of Kotlin native?
r

raulraja

03/10/2019, 9:30 PM
Not sure if you are referring to a Union style data types but Arrow has Either, Coproduct and in general support for Union style types..
n

Nicole

03/11/2019, 12:34 AM
Something like where I could access a variable as either, say, an int or a byte array length 4
s

sitepodmatt

03/11/2019, 1:43 AM
sealed class with data classes wrapping the underlying types is the closest you will get unfortunately

https://www.youtube.com/watch?v=uGMm3StjqLI&t=1s

but there no tagged or untagged unions in kotlin
👍 1