Intersection types do actually exist in Kotlin's type system. Even though we can't denote them, we can still use them!
https://youtu.be/d_vP_wEnjT4▾
🐕 2
K 9
mind blown 1
👍 2
y
Youssef Shoaib [MOD]
02/07/2024, 3:51 PM
Nice video!
This rabbit hole goes deeper btw. You can combine this with contracts, the
_
operator for type arguments, a concept I love called `TypeWrapper`s, and then you can get very very close to denoting intersection types.
I'll drop some code here later if that's of interest!
👀 3
c
CLOVIS
02/07/2024, 4:26 PM
I'm interested 🙂
d
Dave Leeds
02/07/2024, 5:17 PM
@Youssef Shoaib [MOD] - Yes, for sure - I'd love to see how that works! 👍