lean4-htt/tests/lean/interactive/5659.lean
Sebastian Graf f01471f620
fix: proper "excess binders" error locations for rintro and intro (#6565)
This PR fixes the location of the error emitted when the `rintro` and
`intro` tactics cannot introduce the requested number of binders.

This patch adds a few `withRef` wrappers to invocations of
`MVarId.intro` to fix error locations. Perhaps `MVarId.intro` should
take a syntax object to set the location itself in the future; however
there are a couple other call sites which would need non-trivial fixup.

Closes  #5659.
2025-01-08 08:36:45 +00:00

13 lines
450 B
Text

/-!
# `rintro` and `intro` error message should point to excess arg
Below, the errors should point to `h` because there is no lambda it binds.
The error should not point to `hn`; it would be OKish to underline the whole line. -/
example : (∃ n : Nat, n < 0) → False := by
rintro ⟨n, hn⟩ h
--^ collectDiagnostics
example : (∃ n : Nat, n < 0) → False := by
intro ⟨n, hn⟩ h
--^ collectDiagnostics