lean4-htt/tests/lean/run/renameI.lean
Leonardo de Moura 9f305fb31f
fix: rename_i in macro (#3581)
closes #3553

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2024-03-03 19:05:37 +00:00

23 lines
511 B
Text

example : ∀ a b c d : Nat, a = b → a = d → a = c → c = b := by
intros
rename_i h1 _ h2
apply Eq.trans
apply Eq.symm
exact h2
exact h1
/-!
Within a tactic macro, all identifiers *not* from this quotation should be regarded as inaccessible.
-/
macro "my_tac " h:ident : tactic =>
`(tactic| (
cases $h:ident
rename_i h_p3
rename_i h_p1_p2 -- must rename `left`, not `h_p3`
cases h_p1_p2 -- fails otherwise
))
example (h : (p1 ∧ p2) ∧ p3) : True := by
my_tac h
sorry