Make unions more space-efficient after https://github.com/core-lang/core/issues/8 is implemented, ideally avoiding the need for additional space to store bits that denote the variant of a union value.
For class-based unions:
consider the lower bits of the reference itself
figure out what to do with union variants that are themselves unions
For value-based unions:
employ niche-oriented encoding
investigate passing variant info out-of-band (status flags (Swift appears doing something like that), additional reg, ...)
For mixed unions:
figure out what the actual rules and requirements are
Make unions more space-efficient after https://github.com/core-lang/core/issues/8 is implemented, ideally avoiding the need for additional space to store bits that denote the variant of a union value.
For class-based unions:
For value-based unions:
For mixed unions: