aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/modules/polymorphism2.v
blob: 7e3327eee0c8cd81e1d1ce7f5e8859f49efa7e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Set Universe Polymorphism.

(** Tests for module subtyping of polymorphic terms *)

Module Type S.

Section Foo.

Universes i j.
Constraint i <= j.

Inductive foo : Type@{i} -> Type@{j} :=.

End Foo.

End S.

(** Same constraints *)

Module OK_1.

Section Foo.

Universes i j.
Constraint i <= j.

Inductive foo : Type@{i} -> Type@{j} :=.

End Foo.

End OK_1.

Module OK_1_Test : S := OK_1.

(** More general constraints *)

Module OK_2.

Inductive foo@{i j} : Type@{i} -> Type@{j} :=.

End OK_2.

Module OK_2_Test : S := OK_2.

(** Wrong instance length *)

Module KO_1.

Inductive foo@{i} : Type@{i} -> Type@{i} :=.

End KO_1.

Fail Module KO_Test_1 : S := KO_1.

(** Less general constraints *)

Module KO_2.

Section Foo.

Universe i j.
Constraint i < j.

Inductive foo : Type@{i} -> Type@{j} :=.

End Foo.

End KO_2.

Fail Module KO_Test_2 : S := KO_2.

(** Less general constraints *)

Module KO_3.

Section Foo.

Universe i j.
Constraint i = j.

Inductive foo : Type@{i} -> Type@{j} :=.

End Foo.

End KO_3.

Fail Module KO_Test_3 : S := KO_3.