4 ms·
This doesn't strike me as that different than an enum.
by taurknaut 2y ago
This doesn't strike me as that different than an enum.
- MathMonkeyMan 2y agoArithmetic is defined on range types. So day 30 + day 4 is 34, which if you then try to coerce into a day will throw an exception.
- dragonwriter 2y agoAnd... So? It seems you are saying Day_type + Integer is Integer, and Integer (in general) cannot safely be coerced into Day_type and... that’s logically correct?
- MathMonkeyMan 2y ago`Day_type + Day_type` is also defined, and it overflows. That's like normal integers, and unlike enums.