lean4-htt/tests/lean/run/coeAttrs.lean
Tony Beta Lambda 99031695bd
feat: display coercions with a type ascription (#6119)
This PR adds a new delab option `pp.coercions.types` which, when
enabled, will display all coercions with an explicit type ascription.

[Link to Zulip
discussion](https://leanprover.zulipchat.com/#narrow/channel/239415-metaprogramming-.2F-tactics/topic/Roundtripping.20delaboration.20involving.20coercions)

Towards #4315
2024-11-21 23:02:47 +00:00

26 lines
428 B
Text

/-!
# Tests for `pp.coercions.types` option
-/
-- With the option off (default)
/--
info: n : Nat
h : n = 0
⊢ ↑n = 0
-/
#guard_msgs in
example (n : Nat) (h : n = 0) : (↑n : Int) = 0 := by
trace_state
simp [h]
-- With the option on
/--
info: n : Nat
h : n = 0
⊢ (↑n : Int) = 0
-/
#guard_msgs in
set_option pp.coercions.types true in
example (n : Nat) (h : n = 0) : (↑n : Int) = 0 := by
trace_state
simp [h]