Debian Codegraph @

test-suite/bugs/HoTT_coq_025.v

raw
1 Module monomorphic.
2 Class Inhabited (A : Type) : Prop := populate { _ : A }.
3 Arguments populate {_} _.
4
5 #[export] Instance prod_inhabited {A B : Type} (iA : Inhabited A)
6 (iB : Inhabited B) : Inhabited (A * B) :=
7 match iA, iB with
8 | populate x, populate y => populate (x,y)
9 end.
10 (* Error: In environment
11 A : Type
12 B : Type
13 iA : Inhabited A
14 iB : Inhabited B
15 The term "(A * B)%type" has type "Type" while it is expected to have type
16 "Prop". *)
17 End monomorphic.
18
19 Module polymorphic.
20 Set Universe Polymorphism.
21 Class Inhabited (A : Type) : Prop := populate { _ : A }.
22 Arguments populate {_} _.
23
24 #[export] Instance prod_inhabited {A B : Type} (iA : Inhabited A)
25 (iB : Inhabited B) : Inhabited (A * B) :=
26 match iA, iB with
27 | populate x, populate y => populate (x,y)
28 end.
29 End polymorphic.