> And there's a good reason almost no statically typed language has support for union types
For what it's worth, I learned about union types from Ceylon, which was statically typed.
For what it's worth, I learned about union types from Ceylon, which was statically typed.
Type erasure at runtime simply isn't really possible with full union typing and looking at it as a consequence Ceylon has to box everything into a structure which contains a type tag which is obviously not an overhead a language such as Rust is willing to pay.