What kind of syntax is that??? Union type in Kotli...
# react
r
What kind of syntax is that??? Union type in Kotlin?
😀 2
🔥 2
b
You mean intersection?
r
yes
b
Fun fact, union types are already in kotlin IR and used by the compiler internally. We also have a single union type in public type system -
Any? = Any | null
First time I'm seeing intersections, though
t
сс @Sergei Grishchenko
s
Copy code
fun <P> fn(props: P) where P : FirstInterface, P : SecondInterface
It is example of intersections in kotlin, type P will have type
FirstInterface & SecondInterface
but it is quite limited solution for intersection declaration
👍 2