Merged
Conversation
1188c79 to
03acdfe
Compare
03acdfe to
2e47768
Compare
chambart
approved these changes
Sep 24, 2025
Contributor
chambart
left a comment
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.