Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/Lean/Meta/Tactic/Grind/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def mkResult (params : Params) (failure? : Option Goal) : GrindM Result := do
logInfo msg
let rings := (← Sym.Arith.getArithState).rings
let numBranches := (← get).numBranches
return { identity := params.identity, failure?, issues, config := params.config, counters, simp, splitDiags, ematchDiags, rings, numBranches }
return { identity := params.identity, failure?, issues, config := (← getConfig), counters, simp, splitDiags, ematchDiags, rings, numBranches }

def GrindM.runAtGoal (mvarId : MVarId) (params : Params) (k : Goal → GrindM α) (evalTactic? : Option EvalTactic := none) : MetaM α := do
let go : GrindM α := withGTransparency do
Expand Down
28 changes: 28 additions & 0 deletions tests/elab/grind_finish_threshold_config.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/-! The failure message of `finish` names the thresholds of its own configuration items. -/

opaque f : Nat → Nat

/-- warning: declaration uses `sorry` -/
#guard_msgs in
@[grind =] theorem f_succ (n : Nat) : f (n + 1) = f n + 1 := sorry

/--
error: `finish` has failed after reaching the thresholds `(instances := 5)` and `(ematch := 5)`, use `+verbose` to obtain diagnostic information
-/
#guard_msgs in
example (h : f 0 = 0) : f 30 = 31 := by
grind => finish (instances := 5)

/--
error: `grind` has failed after reaching the thresholds `(instances := 5)` and `(ematch := 5)`, use `+verbose` to obtain diagnostic information
-/
#guard_msgs in
example (h : f 0 = 0) : f 30 = 31 := by
grind (instances := 5)

/--
error: `finish` has failed after reaching the thresholds `(instances := 5)` and `(ematch := 5)`, use `+verbose` to obtain diagnostic information
-/
#guard_msgs in
example (h : f 0 = 0) : f 30 = 31 := by
grind => set_config (instances := 5) in finish
Loading