-
Notifications
You must be signed in to change notification settings - Fork 123
Support for phantom bindings #3937
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
1188c79 to
03acdfe
Compare
03acdfe to
2e47768
Compare
chambart
left a comment
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.
Ok this looks sound.
It's hard to tell whether anything is missing out of the changes that would lose any bindings. But the changes themselves seems ok.
There are a few places where It's quite hard to know if the name modes are actually the right one, but I don't know how to verify that without too much effort. I suppose that trying it in the wild is quite safe, as if anything is wrong on that part, this is going to fail quite loudly with all the information we need.
01c7443 to
de64a85
Compare
de64a85 to
88b9b9b
Compare
This PR restores support for generating phantom bindings.
I wrote it by enabling phantom lets, and fixing errors as I find them. Given the number of bugs I had to fix, it is likely that some remain in some less-tested corner cases.
Here is a summary of the changes:
In_types, so I madePhantomgreater thanIn_typesinstead of not comparable. It would also be possible to prevent the typing env from handling variables inPhantommode, and that should make the environments smaller, but I think it should be a separate PR.Expr_builderto decide whether to keep a binding, delete it or phantomise it has been moved toSimplify_let_expr.rebuild_let. This makes decisions more consistent (now even bindings removed by mutable unboxing get phantomised if needed)Deletedcode IDs to avoid keeping old code around.It is possible that this PR still contains changes that were made redundant by a more general fix. Do not hesitate to point these out during review.