-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#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.
- Loading branch information
Showing
6 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/-! | ||
# `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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{"version": 1, | ||
"uri": "file:///5659.lean", | ||
"diagnostics": | ||
[{"source": "Lean 4", | ||
"severity": 1, | ||
"range": | ||
{"start": {"line": 7, "character": 17}, "end": {"line": 7, "character": 18}}, | ||
"message": | ||
"tactic 'introN' failed, insufficient number of binders\ncase intro\nn : Nat\nhn : n < 0\n⊢ False", | ||
"fullRange": | ||
{"start": {"line": 7, "character": 17}, | ||
"end": {"line": 7, "character": 18}}}, | ||
{"source": "Lean 4", | ||
"severity": 1, | ||
"range": | ||
{"start": {"line": 11, "character": 16}, | ||
"end": {"line": 11, "character": 17}}, | ||
"message": | ||
"tactic 'introN' failed, insufficient number of binders\nn : Nat\nhn : n < 0\n⊢ False", | ||
"fullRange": | ||
{"start": {"line": 11, "character": 16}, | ||
"end": {"line": 11, "character": 17}}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters