| 1 |
(* coq-prog-args: ("-async-proofs" "off") *) |
| 2 |
|
| 3 |
#[universes(cumulative=yes)] |
| 4 |
Polymorphic Class t@{+s} (S : Type@{s}) (A B : Prop) := |
| 5 |
T { |
| 6 |
prf : S -> A -> B; |
| 7 |
}. |
| 8 |
Monomorphic Inductive X@{s | Set < s} : Type@{s} := x. |
| 9 |
|
| 10 |
#[refine, export] |
| 11 |
Instance t_X_refl {A} : t X A A := {|prf := _|}. |
| 12 |
Proof. auto. Qed. |
| 13 |
|
| 14 |
Module A. |
| 15 |
(* Note universe constraint! *) |
| 16 |
Lemma foo@{s|X.s < s} : forall A, t@{s} X A A. |
| 17 |
Proof. |
| 18 |
assert_succeeds typeclasses eauto. |
| 19 |
intros; typeclasses eauto. (* fails but should succeed, I think *) |
| 20 |
Qed. |
| 21 |
End A. |
| 22 |
|
| 23 |
|
| 24 |
Module B. |
| 25 |
(* No universe constraint this time! *) |
| 26 |
Lemma foo@{s} : forall A, t@{s} X A A. |
| 27 |
Proof. |
| 28 |
assert_succeeds (intros; typeclasses eauto). (* succeeds now *) |
| 29 |
typeclasses eauto. (* succeeds as before *) |
| 30 |
Qed. |
| 31 |
End B. |