test-suite/bugs/bug_2095.v
raw| 1 | (* Classes and sections *) |
| 2 | |
| 3 | Section OPT. |
| 4 | Variable A: Type. |
| 5 | |
| 6 | Inductive MyOption: Type := |
| 7 | | MyNone: MyOption |
| 8 | | MySome: A -> MyOption. |
| 9 | |
| 10 | Class Opt: Type := { |
| 11 | f_opt: A -> MyOption |
| 12 | }. |
| 13 | End OPT. |
| 14 | |
| 15 | Definition f_nat (n: nat): MyOption nat := MySome _ n. |
| 16 | |
| 17 | #[export] Instance Nat_Opt: Opt nat := { |
| 18 | f_opt := f_nat |
| 19 | }. |