Skip to content

Commit

Permalink
fix: apply ... at with field notation (#8911)
Browse files Browse the repository at this point in the history
add a test to make sure `apply h.mp at` can be parsed and fix it.
  • Loading branch information
joneugster committed Dec 8, 2023
1 parent d76f152 commit cf68d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Mathlib/Tactic/ApplyAt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ then replace the type of `i` with `αᵢ₊₁ → ⋯ → αₙ` by applying th
original `i`.
-/
elab "apply" t:term "at" i:ident : tactic => withMainContext do
let f ← Term.elabTerm (← `(@$t)) none
let f ← elabTermForApply t
let some ldecl := (← getLCtx).findFromUserName? i.getId
| throwErrorAt i m!"Identifier {i} not found"
let (mvs, bis, tp) ← forallMetaTelescopeReducingUntilDefEq (← inferType f) ldecl.type
Expand Down
6 changes: 6 additions & 0 deletions test/ApplyAt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ example {α β : Type*} (a : α) (b : β) : α × β := by
example {α β : Type*} (a : α) (b : β) : α × β := by
fail_if_success apply a at b
exact (a, b)

-- testing field notation
example {A B : Prop} (h : A ↔ B) : A → B := by
intro hA
apply h.mp at hA
assumption

0 comments on commit cf68d15

Please sign in to comment.