fix: synthPending bug
This commit is contained in:
parent
aff28f51cd
commit
72e7bf4999
2 changed files with 16 additions and 1 deletions
|
|
@ -644,7 +644,7 @@ def synthInstance (type : Expr) (maxResultSize? : Option Nat := none) : MetaM Ex
|
|||
(fun _ => throwError "failed to synthesize{indentExpr type}")
|
||||
|
||||
@[export lean_synth_pending]
|
||||
private def synthPendingImp (mvarId : MVarId) : MetaM Bool := withIncRecDepth do
|
||||
private def synthPendingImp (mvarId : MVarId) : MetaM Bool := withIncRecDepth <| withMVarContext mvarId do
|
||||
let mvarDecl ← getMVarDecl mvarId
|
||||
match mvarDecl.kind with
|
||||
| MetavarKind.synthetic =>
|
||||
|
|
|
|||
15
tests/lean/run/synthPendingBug.lean
Normal file
15
tests/lean/run/synthPendingBug.lean
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
inductive Nested
|
||||
| nest (a : Array Nested) : Nested
|
||||
|
||||
class OfUnit (α : Type) where
|
||||
ofUnit : Unit → Except String α
|
||||
|
||||
instance myArrayInst [OfUnit α] : OfUnit (Array α) where
|
||||
ofUnit _ := Except.error ""
|
||||
open OfUnit
|
||||
|
||||
partial def ofUnitNested (_ : Unit) : Except String Nested := do
|
||||
let localinst : OfUnit Nested := ⟨ofUnitNested⟩
|
||||
let units : Array Unit ← Except.ok #[]
|
||||
let a ← ofUnit ()
|
||||
return Nested.nest a
|
||||
Loading…
Add table
Reference in a new issue