| 1 |
(* The second "match" below used to raise an anomaly *) |
| 2 |
|
| 3 |
Class Monad@{d c} (m : Type@{d} -> Type@{c}) : Type := |
| 4 |
{ ret : forall {t : Type@{d}}, t -> m t }. |
| 5 |
|
| 6 |
Record state {S : Type} (t : Type) : Type := mkState { runState : t }. |
| 7 |
|
| 8 |
Global Declare Instance Monad_state : forall S, Monad (@state S). |
| 9 |
|
| 10 |
Class Cava := { |
| 11 |
constant : bool -> unit; |
| 12 |
constant_vec : unit; |
| 13 |
}. |
| 14 |
|
| 15 |
Axiom F : forall {A : Type}, (bool -> A) -> Datatypes.unit. |
| 16 |
|
| 17 |
Fail #[export] Instance T : Cava := { |
| 18 |
|
| 19 |
constant b := match b with |
| 20 |
| true => ret tt |
| 21 |
| false => ret tt |
| 22 |
end; |
| 23 |
|
| 24 |
constant_vec := @F _ (fun b => match b with |
| 25 |
| true => tt |
| 26 |
| false => tt |
| 27 |
end); |
| 28 |
|
| 29 |
}. |