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.
13 lines
450 B
Text
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
|