-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid delaborating with field notation if object is a metavariab…
…le (#6014) This PR prevents `Nat.succ ?_` from pretty printing as `?_.succ`, which should make `apply?` be more usable. Closes #5993
- Loading branch information
Showing
6 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/-! | ||
# Avoid delaborating with field notation if object is a metavariable application. | ||
https://github.com/leanprover/lean4/issues/5993 | ||
-/ | ||
|
||
set_option pp.mvars false | ||
|
||
/-! | ||
No field notation notation here. Used to print `refine ?_.succ` and `refine ?_.snd`. | ||
-/ | ||
|
||
/-- | ||
info: Try this: refine Nat.succ ?_ | ||
--- | ||
info: Try this: refine Prod.snd ?_ | ||
-/ | ||
#guard_msgs in | ||
example : Nat := by | ||
show_term refine Nat.succ ?_ | ||
show_term refine Prod.snd (α := Int) ?_ | ||
exact default | ||
|
||
/-! | ||
No field notation even under binders. (That is, be aware of delayed assignment metavariables.) | ||
-/ | ||
|
||
/-- info: Try this: refine fun x => Nat.succ ?_ -/ | ||
#guard_msgs in | ||
example : Nat → Nat := by | ||
show_term refine fun _ => Nat.succ ?_ | ||
exact default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters