File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/Lean/Meta/Tactic/Grind Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,15 @@ def propagateCtor (a b : Expr) : GoalM Unit := do
4141 let info ← getConstInfo injDeclName
4242 let n := info.type.getForallArity
4343 let mask : Array (Option Expr) := .replicate n none
44- let mask := mask.set! (n-1 ) (some (← mkEqProof a b))
44+ /-
45+ We use `mkExpectedTypeHint` here to ensure that `mkAppOptM` will "fill" the implicit
46+ arguments of `injDeclName` using exactly the fields of `a` and `b`.
47+ There is no guarantee that `inferType (← mkEqProof a b)` is structurally equal to `a = b`.
48+ -/
49+ let mask := mask.set! (n-1 ) (some (← mkExpectedTypeHint (← mkEqProof a b) (← mkEq a b)))
4550 let injLemma ← mkAppOptM injDeclName mask
46- propagateInjEqs (← inferType injLemma) injLemma
51+ let injLemmaType ← inferType injLemma
52+ propagateInjEqs injLemmaType injLemma
4753 else
4854 let .const declName _ := aType.getAppFn | return ()
4955 let noConfusionDeclName := Name.mkStr declName "noConfusion"
You can’t perform that action at this time.
0 commit comments