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.
I wanted to merely improve error reporting by showing more than one type error when it was possible (#1044 )
Along the way, I found a long standing bug with locations incorrectly being set to be their outermost scope. I had noticed this before, but hadn't run it down. I had assumed it was part of typechecking and just due to inference being a bit non-specific when unifying across many types.
But in my example, I wound up printing out the Expr and seeing that the Declarations and Regions were set wrong.
The bug turned out to be the
.as
fromFunctor
. The Expr traverse instance is doing what you say, but .as isn't what we meant. We wanted to only replace the outermost tag, not every tag transitively.I have removed that code since we were only using it for this one bug. :)
This also should do more parallel checking of errors: if two adjacent lets don't depend on each other, we check in parallel.
We can do a bit better by only skipping lets that depend on a previous failed let, but I will punt that to a later PR.