lean4-htt/tests/lean/structInstExtraEta.lean
Kyle Miller 655ec964f5
feat: flatten parent projections when pretty printing structure instance notation (#3749)
Given
```lean
structure A where
  x : Nat

structure B extends A where
  y : Nat
```
rather than pretty printing `{ x := 1, y := 2 : B }` as `{ toA := { x :=
1 }, y := 2 }`, it now pretty prints as `{ x := 1, y := 2 }`.

The option `pp.structureInstances.flatten` controls whether to flatten
structure instances like this.
2024-03-23 09:20:52 +00:00

27 lines
369 B
Text

/-!
# Testing eta reduction for structure instances
Implemented in PR #2478 for issue #2451.
-/
set_option pp.structureInstances.flatten false
structure A where
x : Nat
structure B extends A
structure C extends B
structure D extends B
def a : A := ⟨ 0 ⟩
def b : B := { a with }
#print b
def c : C := { a with }
#print c
def d : D := { c with }
#print d