Skip to content

Commit 9eb173e

Browse files
authored
fix: ignore no_index around OfNat.ofNat in norm_cast (#6438)
This PR ensures `norm_cast` doesn't fail to act in the presence of `no_index` annotations While #2867 exists, it is necessary to put `no_index` around `OfNat.ofNat` in simp lemmas. This results in extra `Expr.mdata` nodes, which must be removed before checking for `ofNat` numerals.
1 parent 8d9d814 commit 9eb173e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Lean/Elab/Tactic/NormCast.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def isNumeral? (e : Expr) : Option (Expr × Nat) :=
6363
if e.isConstOf ``Nat.zero then
6464
(mkConst ``Nat, 0)
6565
else if let Expr.app (Expr.app (Expr.app (Expr.const ``OfNat.ofNat ..) α ..)
66-
(Expr.lit (Literal.natVal n) ..) ..) .. := e then
66+
(Expr.lit (Literal.natVal n) ..) ..) .. := e.consumeMData then
6767
some (α, n)
6868
else
6969
none

0 commit comments

Comments
 (0)