Grift icon indicating copy to clipboard operation
Grift copied to clipboard

Should casting to a subtype be allowed?

Open LuKuangChen opened this issue 7 years ago • 1 comments

This program cannot be compiled with the latest Grift in the master branch.

(: (: (tuple 777 #f) (Tuple Int)) (Tuple Int Bool))

LuKuangChen avatar Jan 16 '19 20:01 LuKuangChen

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.

akuhlens avatar Jan 17 '19 19:01 akuhlens