lean4-htt/tests/lean/run/3554.lean
Eric Wieser b814be6d6a
fix: use MessageData.tagged to mark maxHeartbeat exceptions (#5566)
Fixes #5565, by using tags instead of trying to string match on a
`MessageData`. This ends up reverting some unwanted test output changes
from #4781 too.

This changes `isMaxRecDepth` for good measure too.

This was a regression in Lean 4.11.0, so may be worth backporting to
4.12.x, if not also 4.11.x.
2024-10-09 02:08:50 +00:00

37 lines
866 B
Text

def foo : Nat → Nat
| 0 => 0
| n+1 => foo n + 1
set_option debug.moduleNameAtTimeout false
/--
error: (deterministic) timeout, maximum number of heartbeats (100) has been reached
Use `set_option maxHeartbeats <num>` to set the limit.
Additional diagnostic information may be available using the `set_option diagnostics true` command.
-/
#guard_msgs in
set_option maxHeartbeats 100 in
theorem bar : True := by
simp [show foo 1000 = 1000 from rfl]
/--
info: theorem bar : True :=
sorryAx True true
-/
#guard_msgs in
#print bar
/--
error: maximum recursion depth has been reached
use `set_option maxRecDepth <num>` to increase limit
use `set_option diagnostics true` to get diagnostic information
-/
#guard_msgs in
theorem bar2 : True := by
simp [show foo 1000 = 1000 from rfl]
/--
info: theorem bar2 : True :=
sorryAx True true
-/
#guard_msgs in
#print bar2