lean4-htt/tests/lean/run/structure_opt_param.lean
Leonardo de Moura 0b19ef82e1 feat(frontends/lean/structure_cmd): default parameter for structure/class declarations
Remark: we support them at inductive declarations.
2017-06-28 12:20:56 -07:00

17 lines
201 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 S (α : Type := int) :=
(a b : α)
def x : S :=
{a := 10, b := 10}
#check x.a
def y : S nat :=
{a := 10, b := 10}
#check y.a
def z : S string :=
{a := "hello", b := "world"}
#check z.a