Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #12418 (inference of return clause meets assert false).
This is a quick fix to avoid the anomaly, with a fallback on before b1b8243.
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(* The second "match" below used to raise an anomaly *) | ||
|
||
Class Monad@{d c} (m : Type@{d} -> Type@{c}) : Type := | ||
{ ret : forall {t : Type@{d}}, t -> m t }. | ||
|
||
Record state {S : Type} (t : Type) : Type := mkState { runState : t }. | ||
|
||
Global Declare Instance Monad_state : forall S, Monad (@state S). | ||
|
||
Class Cava := { | ||
constant : bool -> unit; | ||
constant_vec : unit; | ||
}. | ||
|
||
Axiom F : forall {A : Type}, (bool -> A) -> Datatypes.unit. | ||
|
||
Fail Instance T : Cava := { | ||
|
||
constant b := match b with | ||
| true => ret tt | ||
| false => ret tt | ||
end; | ||
|
||
constant_vec := @F _ (fun b => match b with | ||
| true => tt | ||
| false => tt | ||
end); | ||
|
||
}. |