fix: Motive extra arguments not instiantiated
This commit is contained in:
parent
4cff6677d2
commit
63417ef179
|
@ -32,8 +32,8 @@ protected def getMotiveType (info: RecursorWithMotive): Expr :=
|
||||||
let a := info.args.get! level
|
let a := info.args.get! level
|
||||||
a
|
a
|
||||||
|
|
||||||
protected def surrogateMotiveType (info: RecursorWithMotive) (resultant: Expr): MetaM Expr := do
|
protected def surrogateMotiveType (info: RecursorWithMotive) (mvars: Array Expr) (resultant: Expr): MetaM Expr := do
|
||||||
let motiveType := info.getMotiveType
|
let motiveType := Expr.instantiateRev info.getMotiveType mvars
|
||||||
let resultantType ← Meta.inferType resultant
|
let resultantType ← Meta.inferType resultant
|
||||||
return replaceForallBody motiveType resultantType
|
return replaceForallBody motiveType resultantType
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ def motivatedApply: Elab.Tactic.Tactic := λ stx => do
|
||||||
let argType := argType.instantiateRev prev
|
let argType := argType.instantiateRev prev
|
||||||
let bvarIndex := info.nArgs - i - 1
|
let bvarIndex := info.nArgs - i - 1
|
||||||
let argGoal ← if bvarIndex = info.iMotive then
|
let argGoal ← if bvarIndex = info.iMotive then
|
||||||
let surrogateMotiveType ← info.surrogateMotiveType resultant
|
let surrogateMotiveType ← info.surrogateMotiveType prev resultant
|
||||||
Meta.mkFreshExprMVar surrogateMotiveType .syntheticOpaque (userName := `motive)
|
Meta.mkFreshExprMVar surrogateMotiveType .syntheticOpaque (userName := `motive)
|
||||||
else
|
else
|
||||||
Meta.mkFreshExprMVar argType .syntheticOpaque (userName := .anonymous)
|
Meta.mkFreshExprMVar argType .syntheticOpaque (userName := .anonymous)
|
||||||
|
|
Loading…
Reference in New Issue