forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Reviewed-by: herbelin Co-authored-by: herbelin <[email protected]>
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Class Decodable (A : Type) := decode : nat -> option A. | ||
Class ContainsType := { SomeType : Type; }. | ||
|
||
Section ASection. | ||
Context `{ContainsType}. | ||
|
||
Inductive Wrap := | ||
| wrap : SomeType -> Wrap. | ||
|
||
Axiom any : forall {A}, A. | ||
Global Instance inst : Decodable Wrap := any. | ||
End ASection. | ||
|
||
Instance impl : ContainsType := | ||
{| SomeType := nat; |}. | ||
|
||
(* | ||
Error: Cannot infer the 1st argument of the inductive type (@Wrap) of this term (no type | ||
class instance found) in environment: | ||
n : nat | ||
*) | ||
Definition foo n := | ||
match decode n with | ||
| Some (wrap _) => 0 | ||
| _ => 0 | ||
end. |