Skip to content

Commit 6162839

Browse files
committed
flambda-backend: Whitespace-only promotions
1 parent 044bcad commit 6162839

32 files changed

+1551
-0
lines changed

testsuite/tests/basic-modules/recursive_module_evaluation_errors.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ type t = ..
3636
module rec A: sig type t += A end = struct type t += A = B.A end
3737
and B:sig type t += A end = struct type t += A = A.A end
3838
[%%expect {|
39+
3940
type t = ..
41+
4042
Line 2, characters 36-64:
4143
2 | module rec A: sig type t += A end = struct type t += A = B.A end
4244
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,6 +65,7 @@ end = struct
6365
end
6466
and B: sig val value: unit end = struct let value = A.f () end
6567
[%%expect {|
68+
6669
Lines 4-7, characters 6-3:
6770
4 | ......struct
6871
5 | module F(X:sig end) = struct end
@@ -93,6 +96,7 @@ module F(X: sig module type t module M: t end) = struct
9396
and B: sig val value: unit end = struct let value = A.f () end
9497
end
9598
[%%expect {|
99+
96100
Lines 5-8, characters 8-5:
97101
5 | ........struct
98102
6 | module M = X.M
@@ -115,5 +119,6 @@ Line 9, characters 13-28:
115119
module rec M: sig val f: unit -> int end = struct let f () = N.x end
116120
and N:sig val x: int end = struct let x = M.f () end;;
117121
[%%expect {|
122+
118123
Exception: Undefined_recursive_module ("", 1, 43).
119124
|}]

testsuite/tests/basic-more/tailannots.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ let bad_annot_2 () =
2424
nop () [@tail];
2525
nop ()
2626
[%%expect{|
27+
2728
Line 2, characters 2-8:
2829
2 | nop () [@tail];
2930
^^^^^^
@@ -34,6 +35,7 @@ let bad_annot_3 () =
3435
nop () [@tail hint] [@nontail];
3536
nop ()
3637
[%%expect{|
38+
3739
Line 2, characters 2-8:
3840
2 | nop () [@tail hint] [@nontail];
3941
^^^^^^
@@ -44,6 +46,7 @@ let bad_annot_4 () =
4446
nop () [@tail ajsdiof];
4547
nop ()
4648
[%%expect{|
49+
4750
Line 2, characters 9-24:
4851
2 | nop () [@tail ajsdiof];
4952
^^^^^^^^^^^^^^^
@@ -57,5 +60,6 @@ let good_annot_2 () =
5760
nop () [@tail hint];
5861
nop () [@tail hint]
5962
[%%expect{|
63+
6064
val good_annot_2 : unit -> unit = <fun>
6165
|}]

testsuite/tests/basic/patmatch_incoherence.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ match { x = assert false } with
5151
| { x = "" } -> ()
5252
;;
5353
[%%expect{|
54+
5455
Lines 1-3, characters 0-18:
5556
1 | match { x = assert false } with
5657
2 | | { x = None } -> ()
@@ -67,6 +68,7 @@ match { x = assert false } with
6768
| { x = `X } -> ()
6869
;;
6970
[%%expect{|
71+
7072
Lines 1-3, characters 0-18:
7173
1 | match { x = assert false } with
7274
2 | | { x = None } -> ()
@@ -83,6 +85,7 @@ match { x = assert false } with
8385
| { x = 3 } -> ()
8486
;;
8587
[%%expect{|
88+
8689
Lines 1-3, characters 0-17:
8790
1 | match { x = assert false } with
8891
2 | | { x = [||] } -> ()
@@ -99,6 +102,7 @@ match { x = assert false } with
99102
| { x = 3 } -> ()
100103
;;
101104
[%%expect{|
105+
102106
Lines 1-3, characters 0-17:
103107
1 | match { x = assert false } with
104108
2 | | { x = `X } -> ()
@@ -115,6 +119,7 @@ match { x = assert false } with
115119
| { x = 3 } -> ()
116120
;;
117121
[%%expect{|
122+
118123
Lines 1-3, characters 0-17:
119124
1 | match { x = assert false } with
120125
2 | | { x = `X "lol" } -> ()
@@ -132,6 +137,7 @@ match { x = assert false } with
132137
| { x = 3 } -> ()
133138
;;
134139
[%%expect{|
140+
135141
Lines 1-4, characters 0-17:
136142
1 | match { x = assert false } with
137143
2 | | { x = (2., "") } -> ()

testsuite/tests/comprehensions/array_comprehensions_pure.ml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
182183
Line 1, characters 8-9:
183184
1 | [|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+
245252
Line 1, characters 13-16:
246253
1 | [|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+
258266
Line 1, characters 13-15:
259267
1 | [|x for x in []|];;
260268
^^
261269
Error: This expression has type 'a list
262270
but an expression was expected of type 'b array
263271
|}, Principal{|
272+
264273
Line 1, characters 13-15:
265274
1 | [|x for x in []|];;
266275
^^
@@ -274,6 +283,7 @@ Error: This expression has type 'a list
274283
let empty = [] in
275284
[|x for x in empty|];;
276285
[%%expect{|
286+
277287
Line 2, characters 13-18:
278288
2 | [|x for x in empty|];;
279289
^^^^^
@@ -284,6 +294,7 @@ Error: This expression has type 'a list
284294

285295
List.length [|i for i = 0 to 3|];;
286296
[%%expect{|
297+
287298
Line 1, characters 12-32:
288299
1 | 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+
298310
Line 1, characters 12-15:
299311
1 | [|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+
308321
Line 1, characters 12-15:
309322
1 | [|x for x = 4.2 downto 1.5|];;
310323
^^^
@@ -325,12 +338,15 @@ let t = (module struct
325338
let x = 3
326339
end : S);;
327340
[%%expect {|
341+
328342
module type S = sig type t val x : t end
343+
329344
val t : (module S) = <module>
330345
|}];;
331346

332347
[| M.x for (module M : S) in [| t |] |];;
333348
[%%expect {|
349+
334350
Line 1, characters 19-20:
335351
1 | [| 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+
349366
Line 2, characters 15-16:
350367
2 | for (module M : S) in
351368
^
@@ -359,6 +376,7 @@ Error: Modules are not allowed in this pattern.
359376
|]
360377
|];;
361378
[%%expect {|
379+
362380
Line 2, characters 15-16:
363381
2 | 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+
372391
Line 1, characters 0-39:
373392
1 | [|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+
380400
Line 1, characters 23-24:
381401
1 | [|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+
388409
Line 1, characters 0-45:
389410
1 | [|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+
396418
Line 1, characters 29-30:
397419
1 | [|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+
404427
Line 1, characters 47-48:
405428
1 | [|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+
414438
Line 1, characters 26-31:
415439
1 | [|outer,inner for outer = inner to 3 for inner = 1 to 3|];;
416440
^^^^^
@@ -422,6 +446,7 @@ Hint: Did you mean incr?
422446

423447
Array.append [|true|] [|i for i = 0 to 10|];;
424448
[%%expect{|
449+
425450
Line 1, characters 24-25:
426451
1 | Array.append [|true|] [|i for i = 0 to 10|];;
427452
^
@@ -437,16 +462,19 @@ module M = struct
437462
type t = A | B
438463
end;;
439464
[%%expect{|
465+
440466
module M : sig type t = A | B end
441467
|}];;
442468

443469
let x : M.t array = [|A for _ = 1 to 3|];;
444470
[%%expect{|
471+
445472
val x : M.t array = [|M.A; M.A; M.A|]
446473
|}];;
447474

448475
[|A for _ = 1 to 3|];;
449476
[%%expect{|
477+
450478
Line 1, characters 2-3:
451479
1 | [|A for _ = 1 to 3|];;
452480
^
@@ -455,8 +483,10 @@ Error: Unbound constructor A
455483

456484
Array.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+
460490
Line 1, characters 23-24:
461491
1 | Array.append [|M.B|] [|A for _ = 1 to 3|];;
462492
^

0 commit comments

Comments
 (0)