feat: make sure #check produces some result even when there are pending TC problems
Lean 3 uses the same approach. closes #714
This commit is contained in:
parent
8ec9fda6c4
commit
1f2e92ea04
4 changed files with 7 additions and 3 deletions
|
|
@ -212,7 +212,7 @@ open Meta
|
|||
@[builtinCommandElab Lean.Parser.Command.check] def elabCheck : CommandElab
|
||||
| `(#check%$tk $term) => withoutModifyingEnv $ runTermElabM (some `_check) fun _ => do
|
||||
let e ← Term.elabTerm term none
|
||||
Term.synthesizeSyntheticMVarsNoPostponing
|
||||
Term.synthesizeSyntheticMVarsNoPostponing (ignoreStuckTC := true)
|
||||
let (e, _) ← Term.levelMVarToParam (← instantiateMVars e)
|
||||
let type ← inferType e
|
||||
unless e.isSyntheticSorry do
|
||||
|
|
|
|||
|
|
@ -296,8 +296,8 @@ mutual
|
|||
loop ()
|
||||
end
|
||||
|
||||
def synthesizeSyntheticMVarsNoPostponing : TermElabM Unit :=
|
||||
synthesizeSyntheticMVars (mayPostpone := false)
|
||||
def synthesizeSyntheticMVarsNoPostponing (ignoreStuckTC := false) : TermElabM Unit :=
|
||||
synthesizeSyntheticMVars (mayPostpone := false) (ignoreStuckTC := ignoreStuckTC)
|
||||
|
||||
/- Keep invoking `synthesizeUsingDefault` until it returns false. -/
|
||||
private partial def synthesizeUsingDefaultLoop : TermElabM Unit := do
|
||||
|
|
|
|||
3
tests/lean/714.lean
Normal file
3
tests/lean/714.lean
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def test {α : Type} [LT α] := List α
|
||||
|
||||
#check test
|
||||
1
tests/lean/714.lean.expected.out
Normal file
1
tests/lean/714.lean.expected.out
Normal file
|
|
@ -0,0 +1 @@
|
|||
test : Type
|
||||
Loading…
Add table
Reference in a new issue