lean4-htt/tests/lean/diamond1.lean
Leonardo de Moura 272dd5533f chore: style use · instead of . for lambda dot notation
We are considering removing `.` as an alternative for `·` in the
lambda dot notation (e.g., `(·+·)`).
Reasons:
- `.` is not a perfect replacement for `·` (e.g., `(·.insert ·)`)
- `.` is too overloaded: `(f.x)` and `(f .x)` and `(f . x)`. We want to keep the first two.
2022-03-11 07:49:03 -08:00

27 lines
637 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

structure Bar (α : Type) where
a : α
b : Nat → α
structure Baz (α : Type) where
a : αα
c : Bool → α
d : Nat
set_option structureDiamondWarning false in
structure Foo (α : Type) extends Bar α, Baz α -- Error: parent field type mismatch
set_option structureDiamondWarning false in
structure Foo (α : Type) extends Bar (αα), Baz α
#print Foo
def f (x : Nat) : Foo Nat :=
{ a := fun y => x + y
b := (· + ·)
c := fun _ => x
d := x }
#print f
set_option structureDiamondWarning true in
structure Foo' (α : Type) extends Bar (αα), Baz α -- Warning: parent field duplication