test: simple test for deriving Inhabited
TODO: elaborate `optDeriving` suffix to `inductive/structure` commands
This commit is contained in:
parent
8fd6870931
commit
2a653743a1
1 changed files with 17 additions and 0 deletions
17
tests/lean/run/derivingInhabited.lean
Normal file
17
tests/lean/run/derivingInhabited.lean
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
inductive Foo (α : Type u) (β : Type v) where
|
||||
| mk₁ : α → Foo α β
|
||||
| mk₂ : List β → Foo α β
|
||||
|
||||
deriving instance Inhabited for Foo
|
||||
|
||||
def ex1 : Inhabited (Foo α β) :=
|
||||
inferInstance
|
||||
|
||||
inductive Bla (α : Type u) (β : Type v) where
|
||||
| mk₁ : α → Bla α β
|
||||
| mk₂ : β → Bla α β
|
||||
|
||||
deriving instance Inhabited for Bla
|
||||
|
||||
def ex2 [Inhabited α] : Inhabited (Foo α β) :=
|
||||
inferInstance
|
||||
Loading…
Add table
Reference in a new issue