-
Notifications
You must be signed in to change notification settings - Fork 493
[spec] Add missing subtype rule for exn #1873
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
Conversation
Thanks, this was indeed missing from the SpecTec formulation as well. I just added it there. However, I also noticed that the rules for noexn and noextern are vacuous this way, since there is no other ht between the top and bottom type. So these two rules need to be noexn <: exn and noextern <: extern. Could you fix that for this PR as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have a question. (* current code *)
let rec match_heap_type c t1 t2 =
match t1, t2 with
...
| NoExnHT, t -> match_heap_type c t ExnHT
| NoExternHT, t -> match_heap_type c t ExternHT This code is current implementation of subtype of heap type. (* fixed code *)
let rec match_heap_type c t1 t2 =
match t1, t2 with
...
| NoExnHT, ExnHT -> true
| NoExternHT, ExternHT -> true Is it make sense? |
Yes, you are right. And there should be a test for it. Can I interest you in adding that? :) |
Sure! Actually, I'm currently working on testing subtypes. I'll create another PR for that. |
Ah, no, note that |
Apologies, I provided the wrong example.
|
Ah right, and actually, my earlier comment about the existing rules being vacuous was nonsense: they still work, by reducing the goal to reflexivity of the top type. Otherwise the interpreter would not have succeeded on these tests. :) |
In that case, would updating the interpreter code be sufficient? |
Not even that, the interpreter is alright already. We could also revert the change in the spec I asked you for, but both versions are correct. |
Oh, I see. Thanks for the comments! |
I noticed that subtype rule for exn appears to be missing.
I have added the rule.