Untangle UnionType and NullableType
EDIT: This doesn't make sense, the type of null
is not Never
, it's Never?
, so I think there's still a need for NullableType but I need to think about this some more.
NullableType(typeInt)
, expressed as Int?
, should be treated the same as UnionType(typeInt, typeNever)
, not yet expressible in code.
Having both of these around means their behavior might diverge sooner or later.
NullableType
should probably be removed and UnionType should format itself nicely if one of the payloads is typeNever
.
Edited by Andrej Petrović