lean4-htt/tests/lean/diamond1.lean
Leonardo de Moura fdce7a99e1 feat: structure diamonds basic support
See TODO in the new comments.
2021-08-09 19:01:08 -07:00

27 lines
635 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