test: add test for issue #951

This commit is contained in:
Leonardo de Moura 2022-01-20 17:16:06 -08:00
parent 893b816f82
commit d39025e343
2 changed files with 19 additions and 0 deletions

17
tests/lean/951.lean Normal file
View file

@ -0,0 +1,17 @@
inductive ThingA where
| mkA
deriving Ord
instance : LE ThingA where
le a b := (compare a b).isLE
instance (t₁ t₂ : ThingA) : Decidable (t₁ <= t₂) := inferInstance
-- TODO: we may want to suppress the name of nested instances
#check instDecidableLeThingAInstLEThingA
inductive ThingB where
| mkB
deriving Ord
instance : LE ThingB where
le a b := (compare a b).isLE
instance (t₁ t₂ : ThingB) : Decidable (t₁ <= t₂) := inferInstance
#check instDecidableLeThingBInstLEThingB

View file

@ -0,0 +1,2 @@
instDecidableLeThingAInstLEThingA : (t₁ t₂ : ThingA) → Decidable (t₁ ≤ t₂)
instDecidableLeThingBInstLEThingB : (t₁ t₂ : ThingB) → Decidable (t₁ ≤ t₂)