lean4-htt/tests/lean/run/2916.lean
Joachim Breitner 0e49576fe4
feat: guard_msgs to treat trace messages separate (#8267)
This PR makes `#guard_msgs` to treat `trace` messages separate from
`info`, `warning` and `error`. It also introduce the ability to say
`#guard_msgs (pass info`, like `(drop info)` so far, and also adds
`(check info)` as the explicit form of `(info)`, for completeness.

Fixes #8266
2025-05-09 05:44:34 +00:00

77 lines
1.4 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

set_option pp.coercions false -- Show `OfNat.ofNat` when present for clarity
/--
trace: x : Nat
⊢ OfNat.ofNat 2 = x
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example : nat_lit 2 = x := by
simp only
trace_state
sorry
/--
trace: x : Nat
⊢ OfNat.ofNat 2 = x
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example : nat_lit 2 = x := by
dsimp only -- dsimp made no progress
trace_state
sorry
/--
trace: α : Nat → Type
f : (n : Nat) → α n
x : α (OfNat.ofNat 2)
⊢ f (OfNat.ofNat 2) = x
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (α : Nat → Type) (f : (n : Nat) → α n) (x : α 2) : f (nat_lit 2) = x := by
simp only
trace_state
sorry
/--
trace: x : Nat
f : Nat → Nat
h : f (OfNat.ofNat 2) = x
⊢ f (OfNat.ofNat 2) = x
---
trace: x : Nat
f : Nat → Nat
h : f (OfNat.ofNat 2) = x
⊢ f 2 = x
-/
#guard_msgs in
example (f : Nat → Nat) (h : f 2 = x) : f 2 = x := by
trace_state
simp [OfNat.ofNat]
trace_state
assumption
/--
trace: α : Nat → Type
f : (n : Nat) → α n
x : α (OfNat.ofNat 2)
⊢ f (OfNat.ofNat 2) = x
---
trace: α : Nat → Type
f : (n : Nat) → α n
x : α (OfNat.ofNat 2)
⊢ f 2 = x
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (α : Nat → Type) (f : (n : Nat) → α n) (x : α 2) : f 2 = x := by
trace_state
simp [OfNat.ofNat]
trace_state
sorry