3 ms·
> Pretend we have the following sum type: which looks remarkably like a union to me, if i understand your made-up language.
by zabzonk 4y ago
> Pretend we have the following sum type:
which looks remarkably like a union to me, if i understand your made-up language.
- cdcarter 4y agoIt's not a union, though, it stores references to three memory locations, not just one (as a union represents a single memory location which can have multiple possible interpretations). And the lowered code has nothing protecting it from an invariant where more than one reference is non-null!