Grift
Grift copied to clipboard
Should casting to a subtype be allowed?
This program cannot be compiled with the latest Grift in the master branch.
(: (: (tuple 777 #f) (Tuple Int)) (Tuple Int Bool))
I could go either way on allowing/disallowing this behavior. Allowing it, in general, would require a dynamic check of the non-existent runtime type information. Which means we would have to associate the static type of each tuple with it's tuple. It might also mean that we have to adjust how unit values are implemented, which are conceptually just the empty tuple, but in practice a completely different value.