bobjervis / parasol

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

Enum class objects need to inherit from instance type. #43

Open bobjervis opened 6 years ago

bobjervis commented 6 years ago

When an enum defines class methods, etc. there is an anomaly where you cannot determine the value of the enum from the value of this. Also, you can only convert (without a cast) this to address type. The value of *this is unuable (it is the class value, which cannot be the value of any other expression).

If, however, the enum class type inherits from the instance type and we store the instance value in the base clas, then *this can convert to the base class (i.e. the instance type), which makes intuitive sense.