A well known and tested approach, sum types (tagged unions), would have been way better, but it was cast aside because the designers were apparently unaware of the improvements to union types made since C's inception:
http://www.reddit.com/r/programming/comments/w1ig0/things_i_...