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
26 lines
428 B
Text
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]
|