bobjervis / parasol

The Parasol Language and related core development tools
Apache License 2.0
2 stars 2 forks source link

enum types should not allow use of null as a value. #30

Open bobjervis opened 7 years ago

bobjervis commented 7 years ago

if you have enum, e, you can write 'e = null'' of 'if (e != null)...'. These do not have any meaning under the revised semantics for Parasol enums. In the new semantics, there is a one-to-one mapping between all possible enum values and integers, where the first enum constant in a type is assigned value zero, and all others increment the value by one. Conversion to or from any other numeric or address type preserves that value, to the extent possible.

So, the type analysis code needs to disallow those cases that are currently allowed.