lean4-htt/tests/lean/run/binderNameHintSimp.lean
jrr6 020da5bffb
fix: behavior of hard line breaks in Format strings (#8457)
This PR fixes an issue when including a hard line break in a `Format`
that caused subsequent (ordinary) line breaks to be erroneously
flattened to spaces.

This issue is especially important for displaying notes and hints in
error messages, as these components could appear garbled due to improper
line-break rendering.
2025-05-29 22:10:27 +00:00

38 lines
834 B
Text

/-!
Checks that `simp` removes the `binderNameHint` in the pre-phase, and does not spend time looking
at its arguments.
The following traces should show no rewriting of `x` or `y`, only `z`.
-/
def x : Nat := 0
def y : Nat := 0
def z : Nat := 0
set_option trace.Meta.Tactic.simp.rewrite true
/--
trace: [Meta.Tactic.simp.rewrite] ↓ binderNameHint.eq_1:1000:
binderNameHint x y z
==>
z
[Meta.Tactic.simp.rewrite] unfold z, z ==> 0
[Meta.Tactic.simp.rewrite] eq_self:1000:
0 = 0
==>
True
-/
#guard_msgs in
example : binderNameHint x y z = 0 := by
simp [x, y, z]
/--
trace: [Meta.Tactic.simp.rewrite] ↓ binderNameHint.eq_1:1000:
binderNameHint x y z
==>
z
[Meta.Tactic.simp.rewrite] unfold z, z ==> 0
-/
#guard_msgs in
example : binderNameHint x y z = 0 := by
dsimp [x, y, z]