lean4-htt/tests/lean/run/ppUsingAnonymousConstructor.lean
Kyle Miller acb188f11c
feat: apply pp_using_anonymous_constructor attribute (#3735)
This attribute, which was implemented in #3640, is applied to the
following structures: `Sigma`, `PSigma`, `PProd`, `And`, `Subtype`, and
`Fin`. These were given this attribute in Lean 3.
2024-03-22 00:30:36 +00:00

29 lines
543 B
Text

/-!
# Tests for the `pp_using_anonymous_constructor` attribute
-/
/-!
Custom structure
-/
structure S where
(x y : Nat)
/-- info: { x := 1, y := 2 } : S -/
#guard_msgs in #check {x := 1, y := 2 : S}
attribute [pp_using_anonymous_constructor] S
/-- info: ⟨1, 2⟩ : S -/
#guard_msgs in #check {x := 1, y := 2 : S}
/-!
`Fin`
-/
/-- info: ⟨2, ⋯⟩ : Fin 3 -/
#guard_msgs in #check Fin.mk 2 (by omega : 2 < 3)
/-!
`Subtype`
-/
/-- info: ⟨2, ⋯⟩ : { n // n < 3 } -/
#guard_msgs in #check (⟨2, by omega⟩ : {n : Nat // n < 3})