@@ -179,6 +179,7 @@ Warning 26 [unused-var]: unused variable x.
179179 v} *)
180180[|a for a in [|0 |] for a in [|1 |]| ];;
181181[%% expect{|
182+
182183Line 1 , characters 8-9 :
1831841 | [|a for a in [|0 |] for a in [|1 |]| ];;
184185 ^
@@ -197,6 +198,7 @@ Warning 26 [unused-var]: unused variable a.
197198 v} *)
198199[|(a, b) for b in [|0 |] for _ in [|0 ; 0 |] for a in [|b|] and b = 0 downto - 1 | ];;
199200[%% expect{|
201+
200202- : (int * int ) array = [|(0 , 0 ); (0 , - 1 ); (0 , 0 ); (0 , - 1 )|]
201203| }];;
202204
@@ -205,6 +207,7 @@ Warning 26 [unused-var]: unused variable a.
205207 v} *)
206208[|(a, b) for b in [|1 |] for b in [|0 |] and a in [|b |]|];;
207209[%%expect {|
210+
208211- : (int * int) array = [|(1 , 0 )|]
209212|} ];;
210213
@@ -213,6 +216,7 @@ Warning 26 [unused-var]: unused variable a.
213216 v} * )
214217[|a for a in [|1 |] and _ in [|0 ; 0 |] when a > 0 for a in [|0 |]|];;
215218[%%expect {|
219+
216220- : int array = [|0 ; 0 |]
217221|} ];;
218222
@@ -221,6 +225,7 @@ Warning 26 [unused-var]: unused variable a.
221225 v} * )
222226[|a for a in [|0 |] and _ in [|0 ; 0 |] for a in [|a ; 1 |]|];;
223227[%%expect {|
228+
224229- : int array = [|0 ; 1 ; 0 ; 1 |]
225230|} ];;
226231
@@ -232,6 +237,7 @@ Warning 26 [unused-var]: unused variable a.
232237 comprehension. *)
233238[|() for _ = 0 to 0 | ];
234239[%% expect{|
240+
235241- : unit array = [|() |]
236242| }];;
237243
@@ -242,6 +248,7 @@ Warning 26 [unused-var]: unused variable a.
242248
243249[|x for x in 100 | ];;
244250[%% expect{|
251+
245252Line 1 , characters 13-16 :
2462531 | [|x for x in 100 | ];;
247254 ^^^
@@ -255,12 +262,14 @@ Error: This expression has type int but an expression was expected of type
255262(* It's unclear why these are different based on principality *)
256263[|x for x in [] | ];;
257264[%% expect{|
265+
258266Line 1 , characters 13-15 :
2592671 | [|x for x in [] | ];;
260268 ^^
261269Error : This expression has type 'a list
262270 but an expression was expected of type 'b array
263271| }, Principal {|
272+
264273Line 1 , characters 13-15 :
2652741 | [|x for x in [] | ];;
266275 ^^
@@ -274,6 +283,7 @@ Error: This expression has type 'a list
274283let empty = [] in
275284[|x for x in empty| ];;
276285[%% expect{|
286+
277287Line 2 , characters 13-18 :
2782882 | [|x for x in empty| ];;
279289 ^^^^^
@@ -284,6 +294,7 @@ Error: This expression has type 'a list
284294
285295List. length [|i for i = 0 to 3 | ];;
286296[%% expect{|
297+
287298Line 1 , characters 12-32 :
2882991 | List. length [|i for i = 0 to 3 | ];;
289300 ^^^^^^^^^^^^^^^^^^^^
@@ -295,6 +306,7 @@ Error: This expression has type 'a array
295306
296307[|x for x = 1.5 to 4.2 | ];;
297308[%% expect{|
309+
298310Line 1 , characters 12-15 :
2993111 | [|x for x = 1.5 to 4.2 | ];;
300312 ^^^
@@ -305,6 +317,7 @@ Error: This expression has type float but an expression was expected of type
305317
306318[|x for x = 4.2 downto 1.5 | ];;
307319[%% expect{|
320+
308321Line 1 , characters 12-15 :
3093221 | [|x for x = 4.2 downto 1.5 | ];;
310323 ^^^
@@ -325,12 +338,15 @@ let t = (module struct
325338 let x = 3
326339end : S );;
327340[%% expect {|
341+
328342module type S = sig type t val x : t end
343+
329344val t : (module S ) = < module >
330345| }];;
331346
332347[| M. x for (module M : S ) in [| t |] | ];;
333348[%% expect {|
349+
334350Line 1 , characters 19-20 :
3353511 | [| M. x for (module M : S ) in [| t |] | ];;
336352 ^
@@ -346,6 +362,7 @@ Error: Modules are not allowed in this pattern.
346362 |]
347363| ];;
348364[%% expect {|
365+
349366Line 2 , characters 15-16 :
3503672 | for (module M : S ) in
351368 ^
@@ -359,6 +376,7 @@ Error: Modules are not allowed in this pattern.
359376 |]
360377| ];;
361378[%% expect {|
379+
362380Line 2 , characters 15-16 :
3633812 | for (module M : S ) in
364382 ^
@@ -369,6 +387,7 @@ Error: Modules are not allowed in this pattern.
369387
370388[|i for i = 1 to 3 and i = 3 downto 1 | ];;
371389[%% expect{|
390+
372391Line 1 , characters 0-39 :
3733921 | [|i for i = 1 to 3 and i = 3 downto 1 | ];;
374393 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -377,6 +396,7 @@ Error: Variable i is bound several times in this matching
377396
378397[|i for i = 1 to 3 and i in [|10 ; 20 ; 30 |]|];;
379398[%%expect {|
399+
380400Line 1, characters 23-24:
3814011 | [|i for i = 1 to 3 and i in [|10 ; 20 ; 30 |]|];;
382402 ^
@@ -385,6 +405,7 @@ Error: Variable i is bound several times in this matching
385405
386406[|i for i in [|1 ; 2 ; 3 |] and i = 3 downto 1 | ];;
387407[%% expect{|
408+
388409Line 1 , characters 0-45 :
3894101 | [|i for i in [|1 ; 2 ; 3 |] and i = 3 downto 1 | ];;
390411 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -393,6 +414,7 @@ Error: Variable i is bound several times in this matching
393414
394415[|i for i in [|1 ; 2 ; 3 |] and i in [|10 ; 20 ; 30 |]|];;
395416[%%expect {|
417+
396418Line 1, characters 29-30:
3974191 | [|i for i in [|1; 2; 3|] and i in [|10; 20; 30|]|];;
398420 ^
@@ -401,6 +423,7 @@ Error: Variable i is bound several times in this matching
401423
402424[|i for i , j in [|1 , 10 ; 2 , 20 ; 3 , 30 |] and k , i in [|10 , 1 ; 20 , 2 ; 30 , 3 |]|];
403425[%%expect {|
426+
404427Line 1, characters 47-48:
4054281 | [|i for i, j in [|1, 10; 2, 20; 3, 30|] and k, i in [|10, 1; 20, 2; 30, 3|]|];
406429 ^
@@ -411,6 +434,7 @@ Error: Variable i is bound several times in this matching
411434
412435[|outer ,inner for outer = inner to 3 for inner = 1 to 3 | ];;
413436[%% expect{|
437+
414438Line 1 , characters 26-31 :
4154391 | [|outer,inner for outer = inner to 3 for inner = 1 to 3 | ];;
416440 ^^^^^
@@ -422,6 +446,7 @@ Hint: Did you mean incr?
422446
423447Array. append [|true |] [|i for i = 0 to 10 | ];;
424448[%% expect{|
449+
425450Line 1 , characters 24-25 :
4264511 | Array. append [|true |] [|i for i = 0 to 10 | ];;
427452 ^
@@ -437,16 +462,19 @@ module M = struct
437462 type t = A | B
438463end ;;
439464[%% expect{|
465+
440466module M : sig type t = A | B end
441467| }];;
442468
443469let x : M.t array = [|A for _ = 1 to 3 | ];;
444470[%% expect{|
471+
445472val x : M .t array = [|M .A ; M .A ; M .A |]
446473|}];;
447474
448475[|A for _ = 1 to 3 | ];;
449476[%% expect{|
477+
450478Line 1 , characters 2-3 :
4514791 | [|A for _ = 1 to 3 | ];;
452480 ^
@@ -455,8 +483,10 @@ Error: Unbound constructor A
455483
456484Array. append [|M. B |] [|A for _ = 1 to 3 | ];;
457485[%% expect{|
486+
458487- : M. t array = [|M. B ; M. A ; M. A ; M. A |]
459488| }, Principal {|
489+
460490Line 1 , characters 23-24 :
4614911 | Array. append [|M. B |] [|A for _ = 1 to 3 | ];;
462492 ^
0 commit comments