Handle kind-inference of unkown builtins more gracefully #5899
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.
Overview
Addresses, but doesn't fully solve: #5896
Previously:
Now:
Implementation notes
GenandSolvemonads so we can properly handle errors triggered there.Test coverage
Loose ends
It would be nice to simply ignore definitions which trigger kind checking errors during TDNR; but with the way things are arranged it's quite tricky to separate things.
I think what's happening is we're somewhere collecting all possible matching names, then we infer kinds for all decls and terms which we might possibly reference; before we even do the initial typecheck and before we get to TDNR proper.
I'm not familiar with how the kind checker works, so it may not be so easy as to just cull anything that fails checking, since there are inter-dependencies on kinds between things, e.g. if I cull a type I need to make sure I correctly cull everything which refer to the unification variables in that culled type since they now may never be solved;