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 madePhantom
greater thanIn_types
instead of not comparable. It would also be possible to prevent the typing env from handling variables inPhantom
mode, and that should make the environments smaller, but I think it should be a separate PR.Expr_builder
to 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)Deleted
code 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.