Fix regression around type skolems and if exprs. #80
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.
If we start with:
Typechecking the application (before macro expansion) yields
(where the trees are printed in the form
expr{tpe}
):Note that the type of the second last line contains a skolemized
symbol
_$1#5738
of the existential_$1#5490
. This is createdby this case in
Typer#adapt
:Our ANF rewrites part of this code to:
And later, the state machine transformation splits the last line into
a blank field and an assignment. Typechecking the
Assign
nodeled to the an type error.
This commit manually attributes the types to the
Assign
node soas to avoid these problem.
It also reigns in an overeager rewriting of
If
nodes in theANF transform, which was due to a bug in the label detection
logic introduced in 4fc5463.
Thanks to @gnovark for yet another devilish test case and
analysis of the problem with label detection.