2 ms·
I think there is a way to migrate to an union type myType | null. Instead.
by Kuinox 2y ago
I think there is a way to migrate to an union type myType | null. Instead.
- eru 2y agoUnion types are pretty ugly. Eg they can't distinguish between one or two layers of nullable. Or between null and an optional null. (In eg Rust syntax between `Option<Option<MyType>>` vs `Option<MyType>`. Or `()` vs `Option<()>`, where `()` would be how you spell `null` in Rust.) Using tags is simpler and cleaner.