Skip to content

Commit

Permalink
Merge PR coq#19376: Add test for coq#10259
Browse files Browse the repository at this point in the history
Reviewed-by: herbelin
Co-authored-by: herbelin <[email protected]>
  • Loading branch information
coqbot-app[bot] and herbelin authored Jul 18, 2024
2 parents 33996e4 + f5e3ac7 commit ae019cf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test-suite/bugs/bug_10259.v
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.

0 comments on commit ae019cf

Please sign in to comment.