fix: tolerate type incorrect terms
This bug was producing a type error when I was using `set_option trace.Elab true`
This commit is contained in:
parent
d54c964a51
commit
adae6fdb40
2 changed files with 8 additions and 1 deletions
|
|
@ -156,7 +156,10 @@ def TermInfo.runMetaM (info : TermInfo) (ctx : ContextInfo) (x : MetaM α) : IO
|
|||
|
||||
def TermInfo.format (ctx : ContextInfo) (info : TermInfo) : IO Format := do
|
||||
info.runMetaM ctx do
|
||||
return f!"{← Meta.ppExpr info.expr} : {← Meta.ppExpr (← Meta.inferType info.expr)} @ {formatStxRange ctx info.stx}"
|
||||
try
|
||||
return f!"{← Meta.ppExpr info.expr} : {← Meta.ppExpr (← Meta.inferType info.expr)} @ {formatStxRange ctx info.stx}"
|
||||
catch _ =>
|
||||
return f!"{← Meta.ppExpr info.expr} : <failed-to-infer-type> @ {formatStxRange ctx info.stx}"
|
||||
|
||||
def CompletionInfo.format (ctx : ContextInfo) (info : CompletionInfo) : IO Format :=
|
||||
match info with
|
||||
|
|
|
|||
4
tests/lean/run/traceElabIssue.lean
Normal file
4
tests/lean/run/traceElabIssue.lean
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
set_option trace.Elab true
|
||||
inductive Vec (α : Type u) : Nat → Type u
|
||||
| nil : Vec α Nat.zero
|
||||
| cons {n : Nat} : (head : α) → (tail : Vec α n) → Vec α (Nat.succ n)
|
||||
Loading…
Add table
Reference in a new issue