Kotlin doesn't natively support sum types, so usin...
# announcements
c
Kotlin doesn't natively support sum types, so using
Either
is still error prone: the compiler won't prevent you from accessing the field that's not been set
r
The encoding on Either does not use fields but an ADT. Kotlin has support for encoding sum types via ADTs if not through direct syntax. That is the same as Scala.
So the compiler does guarantee that and using either is never error prone unless you add unsafe methods to it which Kategory's Either does not have.