-
Notifications
You must be signed in to change notification settings - Fork 13
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
Type annotations on switch
#76
Comments
All the instructions are annotated with their continuation types (notably That said, I think it may be the case that in practice |
In the case of cont.bind, the second annotation cannot be derived easily — validation would have to construct a new deftype, and there generally is no principal way of doing so, e.g., because of type recursion. In the case of switch, however, the second type can simply be read off the definition of the first. So the annotation should indeed be unnecessary and we should remove it. That actually simplifies validation, since it avoids an extra comparison with the annotation. |
OK, I will revert the reference interpreter to the single type annotation. |
This patch redefines the `switch` instruction such that it only takes a single immediate type (in addition to the tag). Resolves #76.
The explainer currently has
switch
taking two type annotations, but the second can be computed from the first, so it seems we should only need one. Is there any reason to prefer having both?The text was updated successfully, but these errors were encountered: