Skip to content

Commit 0815df9

Browse files
committed
fix:
1 parent 88430d6 commit 0815df9

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/Lean/Elab/Tactic/Grind/Param.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ public def withParams (params : Grind.Params) (ps : TSyntaxArray ``Parser.Tactic
217217
else
218218
let mut params := params
219219
if only then
220-
params := { params with anchorRefs? := none }
220+
params := { params with
221+
ematch := {}
222+
anchorRefs? := none
223+
}
221224
params ← elabGrindParams params ps (only := only) (incremental := true)
222225
let anchorRefs? := params.anchorRefs?
223226
withReader (fun c => { c with params, ctx.anchorRefs? := anchorRefs? }) do

tests/lean/run/grind_indexmap_trace.lean

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,18 @@ example (m : IndexMap α β) (a : α) (b : β) :
292292
example (m : IndexMap α β) (a : α) (b : β) :
293293
(m.insert a b).findIdx a = if h : a ∈ m then m.findIdx a else m.size := by
294294
grind =>
295-
instantiate only [insert, = mem_indices_of_mem, findIdx]
296-
instantiate only [= getElem?_pos, = getElem?_neg]
295+
instantiate only [findIdx, insert, = mem_indices_of_mem]
296+
instantiate only [= getElem?_neg, = getElem?_pos]
297297
cases #1bba
298-
next => instantiate only [findIdx]
299-
next =>
300-
instantiate only
301-
instantiate only [= HashMap.mem_insert, = HashMap.getElem_insert]
298+
· instantiate only [findIdx]
299+
· finish only [= HashMap.mem_insert, = HashMap.getElem_insert]
300+
301+
example (m : IndexMap α β) (a : α) (b : β) :
302+
(m.insert a b).findIdx a = if h : a ∈ m then m.findIdx a else m.size := by
303+
grind =>
304+
instantiate only [findIdx, insert, = mem_indices_of_mem]
305+
instantiate only [= getElem?_neg, = getElem?_pos]
306+
cases #1bba <;>
307+
finish only [findIdx, = HashMap.mem_insert, = HashMap.getElem_insert]
302308

303309
end IndexMap

0 commit comments

Comments
 (0)