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.
@eddywestbrook and I had some further discussions on #1790, and realized that it allowed non-type-correct terms to be constructed. One such example is, unfortunately, the very SAWCore term I cited in that PR:
ecSplit
's type is(m n : Num) -> (a : isort 0) -> seq (tcMul m n) a -> seq m (seq n a)
. Applying it manually to its type arguments yields a function of typeseq (tcMul u1229 (TCNum 3)) u1230 -> seq u1229 (seq (TCNum 3) u1230)
, which is incompatible with application tox
, whose type transposes the multiplicandsu1229
andTCNum 3
.Indeed,
check_term
applied to this term will reveal its failure to typecheck. I think this may suggest the need for more systematic, in-tool applications ofcheck_term
or its underpinnings, which I'll work on in a forthcoming PR or surface in a separate issue.While I figure out how best to solve the original issue behind #1790, I'm reverting its changes, as they're far more unsound than the previous status quo.