Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should casting to a subtype be allowed? #71

Open
LuKuangChen opened this issue Jan 16, 2019 · 1 comment
Open

Should casting to a subtype be allowed? #71

LuKuangChen opened this issue Jan 16, 2019 · 1 comment

Comments

@LuKuangChen
Copy link

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

(: (: (tuple 777 #f) (Tuple Int)) (Tuple Int Bool))
@akuhlens
Copy link
Collaborator

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 akuhlens changed the title Should casting to subtype be allowed? Should casting to a supertype be allowed? Feb 2, 2019
@akuhlens akuhlens changed the title Should casting to a supertype be allowed? Should casting to a subtype be allowed? Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants