Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Lean/Elab/Tactic/Induction.lean
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ where

-- `checkAltNames` may have looked at arbitrary alternatives, so we need to disable incremental
-- processing of alternatives if it had any effect lest we end up with stale messages
let tacSnaps := if (← MonadLog.hasErrors) then #[] else tacSnaps
Term.withoutTacticIncrementality (cond := (← MonadLog.hasErrors)) do

let mut alts := alts
Expand Down
12 changes: 12 additions & 0 deletions tests/lean/interactive/incrementalCombinator.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ example (n : Nat) : n = n := by
| one => simp
| succ => simp
--^ collectDiagnostics

/-!
"Missing alternative name" should not stick around.
-/
-- RESET
example (n : Nat) : n = n := by
induction n with
| zero => simp
| -- insert here
--^ sync
--^ insert: "succ => sorry"
--^ collectDiagnostics
10 changes: 10 additions & 0 deletions tests/lean/interactive/incrementalCombinator.lean.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,13 @@ i 1.5
"fullRange":
{"start": {"line": 1, "character": 0},
"end": {"line": 6, "character": 18}}}]}
{"version": 2,
"uri": "file:///incrementalCombinator.lean",
"diagnostics":
[{"source": "Lean 4",
"severity": 2,
"range":
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 7}},
"message": "declaration uses 'sorry'",
"fullRange":
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 7}}}]}
Loading