lean4-htt/tests/lean/run/canonM_exists_fun.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

22 lines
674 B
Text

import Lean.Meta.Canonicalizer
import Lean.Elab.Tactic
elab "foo" t:term : tactic => do
let e ← Lean.Elab.Tactic.elabTerm t none
trace[debug] "canonicalizing {e}"
let e' ← (Lean.Meta.canon e).run'
trace[debug] "canonicalized it to {e'}"
/-- info: ∃ f, ∀ (x : Nat), f x = 0 : Prop -/
#guard_msgs in
#check (∃ f : Nat → Nat, ∀ x, f x = 0) -- works fine
/--
trace: [debug] canonicalizing ∃ f, ∀ (x : Nat), f x = 0
[debug] canonicalized it to ∃ f, ∀ (x : Nat), f x = 0
-/
#guard_msgs in
set_option trace.debug true in
example : True := by
foo (∃ f : Nat → Nat, ∀ x, f x = 0) -- used to fail with "unexpected bound variable #1"
trivial