test: simple test for deriving Inhabited

TODO: elaborate `optDeriving` suffix to `inductive/structure` commands
This commit is contained in:
Leonardo de Moura 2020-12-12 18:58:56 -08:00
parent 8fd6870931
commit 2a653743a1

View 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