@@ -23,6 +23,14 @@ let f (type a : immediate) (type b : immediate)
23
23
(type (c : immediate ) (d : immediate ))
24
24
= () ;;
25
25
26
+ module type S_for_layouts = sig
27
+ type t : float64
28
+
29
+ type variant = A : ('a : immediate ). 'a -> variant
30
+ end ;;
31
+
32
+ type ('a : immediate) for_layouts = 'a ;;
33
+
26
34
(* *****************)
27
35
(* Comprehensions *)
28
36
@@ -61,7 +69,7 @@ let f (type a : immediate) (type b : immediate)
61
69
(* Local *)
62
70
63
71
(* parameters *)
64
- let f (local_ x ) ~(local_ y ) ~z :(local_ z ) ?foo :(local_ w = 1 ) = x + y + z + w;;
72
+ let f (local_ x ) ~(local_ y ) ~z :(local_ z ) ?foo :(local_ w = 1 ) () = x + y + z + w;;
65
73
66
74
(* bindings *)
67
75
let g () =
@@ -94,17 +102,22 @@ type 'a parameterized_record = {
94
102
type fn = local_ int -> local_ int ;;
95
103
type nested_fn = (local_ int -> local_ int ) -> local_ int ;;
96
104
type ('a, 'b) labeled_fn =
97
- a :local_ 'a -> ?b:local_ b -> local_ 'a -> (int -> local_ 'b );;
105
+ a :local_ 'a -> ?b:local_ ' b -> local_ 'a -> (int -> local_ 'b );;
98
106
99
107
(* ******************)
100
108
(* Include functor *)
101
109
110
+ module F_struct (_ : sig end ) = struct
111
+ end
112
+
113
+ module type F_sig = functor (_ : sig end ) -> sig end
114
+
102
115
module T = struct
103
- include functor F
116
+ include functor F_struct
104
117
end ;;
105
118
106
119
module type S = sig
107
- include functor F
120
+ include functor F_sig
108
121
end ;;
109
122
110
123
(* *******************)
@@ -115,10 +128,15 @@ let f x =
115
128
| [::] -> [::]
116
129
| ([:x:] [@test.attr1] ) -> (([:x:])[@ test.attr1])
117
130
| ([:x;y:] [@test.attr2][@test.attr3] ) ->
118
- ([:x;y:] [@ test.attr2][@ test.attr3]);;
131
+ ([:x;y:] [@ test.attr2][@ test.attr3])
132
+ | _ -> assert false ;;
119
133
120
134
(* *****************)
121
135
(* Labeled tuples *)
136
+ let z, punned = 4 , 5
137
+ let x_must_be_even _ = assert false
138
+ exception Odd
139
+
122
140
let x = (~x: 1 , ~y: 2 )
123
141
let x = ((~x: 1 , ~y: 2 ) [@ test.attr])
124
142
let _ = ( ~x: 5 , 2 , ~z , ~(punned:int ))
0 commit comments