| 1 |
Set Primitive Projections. |
| 2 |
Class type (t : Type) : Type := |
| 3 |
{ bar : t -> Prop }. |
| 4 |
|
| 5 |
#[export] Instance type_nat : type nat := |
| 6 |
{ bar := fun _ => True }. |
| 7 |
|
| 8 |
Definition foo_bar {n : nat} : bar n := I. |
| 9 |
|
| 10 |
#[local] Hint Resolve (@foo_bar) : typeclass_instances. |
| 11 |
#[local] Hint Resolve I : typeclass_instances. |
| 12 |
Check ltac:(typeclasses eauto with nocore typeclass_instances) : True. |
| 13 |
Check ltac:(typeclasses eauto with nocore typeclass_instances foo) : bar _. |
| 14 |
Existing Class bar. |
| 15 |
Check ltac:(typeclasses eauto with nocore typeclass_instances foo) : bar _. |
| 16 |
#[local] Hint Resolve (@foo_bar) : foo. |
| 17 |
Check ltac:(typeclasses eauto with nocore typeclass_instances foo) : bar _. |