fix: use whnfD at mkNoConfusion

The `split` tactic failed at `Array.sizeOf_lt_of_mem` because the type
in the equality is `Id Bool` when we write `true` instead of `id true`.
This commit is contained in:
Leonardo de Moura 2022-03-03 17:36:08 -08:00
parent 337c55f322
commit f4e98be163

View file

@ -352,7 +352,7 @@ def mkNoConfusion (target : Expr) (h : Expr) : MetaM Expr := do
match type.eq? with
| none => throwAppBuilderException `noConfusion ("equality expected" ++ hasTypeMsg h type)
| some (α, a, b) =>
let α ← whnf α
let α ← whnfD α
matchConstInduct α.getAppFn (fun _ => throwAppBuilderException `noConfusion ("inductive type expected" ++ indentExpr α)) fun v us => do
let u ← getLevel target
return mkAppN (mkConst (Name.mkStr v.name "noConfusion") (u :: us)) (α.getAppArgs ++ #[target, a, b, h])