From 9597451da4c83fd6ba937e4592941b7cb18b45e8 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 20 Oct 2023 17:18:56 -0700 Subject: [PATCH] chore(test): clean up all deprecations and most warnings (#801) --- flake.lock | 14 +- jscomp/test/a_recursive_type.ml | 24 +- jscomp/test/abstract_type.mli | 3 +- jscomp/test/bal_set_mini.ml | 62 ++-- jscomp/test/bdd.ml | 50 +-- jscomp/test/bs_abstract_test.ml | 8 +- jscomp/test/bs_array_test.ml | 1 + jscomp/test/bs_hashset_int_test.ml | 74 ++-- jscomp/test/bs_map_set_dict_test.ml | 16 +- jscomp/test/bs_map_test.ml | 32 +- jscomp/test/bs_poly_map_test.ml | 2 +- jscomp/test/bs_poly_set_test.ml | 8 +- jscomp/test/bs_set_int_test.ml | 192 +++++------ jscomp/test/caml_compare_test.ml | 2 +- jscomp/test/caml_format_test.ml | 91 +++-- jscomp/test/derive_projector_test.ml | 3 +- jscomp/test/dist/jscomp/test/bdd.js | 2 +- jscomp/test/dist/jscomp/test/bs_array_test.js | 320 +++++++++--------- .../test/dist/jscomp/test/equal_box_test.js | 74 ++-- jscomp/test/dist/jscomp/test/fib.js | 2 +- jscomp/test/dist/jscomp/test/for_loop_test.js | 2 +- .../dist/jscomp/test/for_side_effect_test.js | 4 +- jscomp/test/dist/jscomp/test/gpr_4280_test.js | 4 +- jscomp/test/dist/jscomp/test/gpr_4900_test.js | 8 +- jscomp/test/dist/jscomp/test/gpr_4924_test.js | 6 +- jscomp/test/dist/jscomp/test/gpr_977_test.js | 4 +- .../dist/jscomp/test/inline_record_test.js | 6 +- .../dist/jscomp/test/int64_string_bench.js | 6 +- jscomp/test/dist/jscomp/test/js_array_test.js | 4 +- jscomp/test/dist/jscomp/test/libarg_test.js | 2 +- .../dist/jscomp/test/ppx_this_obj_field.js | 6 +- jscomp/test/dist/jscomp/test/qcc.js | 2 +- .../dist/jscomp/test/record_extension_test.js | 4 +- jscomp/test/dist/jscomp/test/test_for_loop.js | 2 +- .../test/dist/jscomp/test/test_primitive.js | 10 +- .../jscomp/test/test_static_catch_ident.js | 2 +- jscomp/test/dist/jscomp/test/test_tuple.js | 2 +- jscomp/test/dune | 9 +- jscomp/test/equal_box_test.ml | 93 +++-- jscomp/test/exception_raise_test.ml | 2 +- jscomp/test/exception_rebound_err_test.ml | 24 +- jscomp/test/ext_string_test.ml | 3 +- jscomp/test/fib.ml | 12 +- jscomp/test/flattern_order_test.ml | 2 +- jscomp/test/for_loop_test.ml | 90 +++-- jscomp/test/for_side_effect_test.ml | 9 +- jscomp/test/functor_def.ml | 18 +- jscomp/test/functors.ml | 3 +- jscomp/test/gpr_1245_test.ml | 35 +- jscomp/test/gpr_1600_test.ml | 5 +- jscomp/test/gpr_1667_test.ml | 20 +- jscomp/test/gpr_1692_test.ml | 10 +- jscomp/test/gpr_1698_test.ml | 4 +- jscomp/test/gpr_2503_test.ml | 2 +- jscomp/test/gpr_4280_test.ml | 4 +- jscomp/test/gpr_4491_test.ml | 4 +- jscomp/test/gpr_4900_test.ml | 18 +- jscomp/test/gpr_4924_test.ml | 68 ++-- jscomp/test/gpr_977_test.ml | 26 +- jscomp/test/inline_record_test.ml | 6 +- jscomp/test/inline_string_test.ml | 6 +- jscomp/test/inner_unused.ml | 19 +- jscomp/test/int64_string_bench.ml | 19 +- jscomp/test/int_hashtbl_test.ml | 28 +- jscomp/test/js_array_test.ml | 1 + jscomp/test/js_date_test.ml | 3 +- jscomp/test/js_exception_catch_test.ml | 26 +- jscomp/test/js_re_test.ml | 7 +- jscomp/test/lexer_test.ml | 33 +- jscomp/test/libarg_test.ml | 2 +- jscomp/test/map_test.ml | 1 - jscomp/test/ppx_this_obj_field.ml | 3 +- jscomp/test/qcc.ml | 2 +- jscomp/test/re_or_res/reasonReact.re | 7 +- .../re_or_res/recursive_react_component.re | 2 +- jscomp/test/rec_value_test.ml | 8 +- jscomp/test/record_extension_test.ml | 38 +-- jscomp/test/record_name_test.ml | 2 +- jscomp/test/scanf_io.ml | 1 - jscomp/test/set_gen.ml | 254 +++++++------- jscomp/test/stringmatch_test.ml | 2 +- jscomp/test/test_bug.ml | 2 +- jscomp/test/test_filename.ml | 7 +- jscomp/test/test_for_loop.ml | 37 +- jscomp/test/test_internalOO.ml | 4 +- jscomp/test/test_per.ml | 70 ++-- jscomp/test/test_primitive.ml | 15 +- jscomp/test/test_seq.ml | 1 - jscomp/test/test_static_catch_ident.ml | 4 +- jscomp/test/test_tuple.ml | 3 +- jscomp/test/ticker.ml | 6 +- jscomp/test/topsort_test.ml | 141 ++++---- jscomp/test/tscanf_test.ml | 6 +- jscomp/test/typeof_test.ml | 2 +- jscomp/test/unboxed_use_case.ml | 6 +- jscomp/test/uncurry_method.ml | 3 +- jscomp/test/unsafe_this.ml | 2 +- 97 files changed, 1134 insertions(+), 1160 deletions(-) diff --git a/flake.lock b/flake.lock index 0cc976ec64..05d28c5809 100644 --- a/flake.lock +++ b/flake.lock @@ -64,11 +64,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1697675160, - "narHash": "sha256-GpDGghNf89dKmvcc8wcFRryyoXT7xo+vYatZtIzHR0c=", + "lastModified": 1697836811, + "narHash": "sha256-/8+vpRNyKU+r9wyAUgHRFnyv/tcdb4k80BNO1y8S4aU=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "2d3c13d6cf9d17106c13bf7675740bc38a9bc00b", + "rev": "db93f0fad3c6aaa8bba0ce5071beb05f80e4d8d0", "type": "github" }, "original": { @@ -79,17 +79,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1697538484, - "narHash": "sha256-Snkk4LL4L3nqRiAJ6/BO9vTnuxbWZhR8jGlfAB5ohPY=", + "lastModified": 1697756275, + "narHash": "sha256-KAZ2F9He5oH2NPxhWDLmtGAsiBjPi7yps1OGZu6peMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2cb9af4323c64c93e8df3cae5988a53b8687ef3f", + "rev": "d042a296139c6a111be3e3d5dc9ef6783b5e7c16", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "2cb9af4323c64c93e8df3cae5988a53b8687ef3f", + "rev": "d042a296139c6a111be3e3d5dc9ef6783b5e7c16", "type": "github" } }, diff --git a/jscomp/test/a_recursive_type.ml b/jscomp/test/a_recursive_type.ml index 97bccfdf59..c89aa7dab8 100644 --- a/jscomp/test/a_recursive_type.ml +++ b/jscomp/test/a_recursive_type.ml @@ -1,34 +1,34 @@ type t = A of (t -> int) -let g = fun x -> - match x with +let g = fun x -> + match x with | A v -> v x -let loop = g (A g ) +let loop = g (A g ) -let non_terminate = (fun x -> - match x with +let non_terminate = (fun x -> + match x with | A v -> v x) (A g) - type t0 = { xx : t0 } + type[@ocaml.warning "-69"] t0 = { xx : t0 } (* [@@unboxed]*) let rec xx = { xx } -type t1 = +type[@ocaml.warning "-34-37"] t1 = | A of t1 array - -type t2 = + +type[@ocaml.warning "-34-37"] t2 = | A2 of t2 array [@@unboxed] -(* let rec h = A [|h|] +(* let rec h = A [|h|] let rec h1 = A [|h1|] // could be relaxed -let rec h2 = A2 [|h2|] +let rec h2 = A2 [|h2|] ;; Js.log (h,h2) *) -(** If we inline g's definition -- it will be the same, inline uncarefully +(** If we inline g's definition -- it will be the same, inline uncarefully (inline the inlined result) will make it non-terminating *) diff --git a/jscomp/test/abstract_type.mli b/jscomp/test/abstract_type.mli index 803f1411ea..5e315ba52d 100644 --- a/jscomp/test/abstract_type.mli +++ b/jscomp/test/abstract_type.mli @@ -1,7 +1,6 @@ -type t +type t type arrow_type = int -> int type 'a poly_type = 'a type 'a poly_abstract_type -open Mt diff --git a/jscomp/test/bal_set_mini.ml b/jscomp/test/bal_set_mini.ml index ced9e320d7..b14ed3a9c3 100644 --- a/jscomp/test/bal_set_mini.ml +++ b/jscomp/test/bal_set_mini.ml @@ -1,68 +1,68 @@ -type 'a t = - | Empty - | Node of 'a t * 'a * 'a t * int -let rec height = function - | Empty -> 0 - | Node(_,_,_,h) -> h +type 'a t = + | Empty + | Node of 'a t * 'a * 'a t * int +let height = function + | Empty -> 0 + | Node(_,_,_,h) -> h -let create l v r = - let hl = height l in - let hr = height r in - Node(l,v,r, if hl >= hr then hl + 1 else hr + 1) +let create l v r = + let hl = height l in + let hr = height r in + Node(l,v,r, if hl >= hr then hl + 1 else hr + 1) let bal l v r = let hl = height l in - let hr = height r in - if hl > hr + 2 then + let hr = height r in + if hl > hr + 2 then match l with | Empty -> Empty (* impossible *) - | Node(ll, lv, lr, _) -> + | Node(ll, lv, lr, _) -> if height ll >= height lr then create ll lv (create lr v r) - else + else match lr with | Empty -> Empty (* impossible *) | Node(lrl, lrv, lrr, _)-> create (create ll lv lrl) lrv (create lrr v r) - else if hr > hl + 2 then + else if hr > hl + 2 then match r with | Empty -> Empty (* impossible *) | Node(rl, rv, rr, _) -> if height rr >= height rl then create (create l v rl) rv rr - else + else match rl with | Empty -> Empty (* impossible *) | Node(rll, rlv, rlr, _) -> create (create l v rll) rlv (create rlr rv rr) else - Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) + Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) let compare_int (x : int) y = if x > y then 1 else if x = y then 0 else -1 -let rec add x = function +let rec add x = function | Empty -> Node(Empty, x, Empty, 1) | Node(l, v, r, _) as t -> let c = compare_int x v in if c = 0 then t else if c < 0 then bal (add x l) v r else bal l v (add x r) -let rec min_elt def = function +let rec min_elt def = function | Empty -> def | Node(Empty, v, r, _) -> v | Node(l, v, r, _) -> min_elt v l (* -let rec remove_min_elt tree = match tree with +let rec remove_min_elt tree = match tree with | Empty -> Empty (* impossible *) | Node(Empty, v, r, _) -> r | Node(l, v, r, _) -> bal (remove_min_elt l) v r *) -let rec remove_min_elt l v r = - match l with - | Empty -> r - | Node(ll,lv,lr,_) -> bal (remove_min_elt ll lv lr) v r +let rec remove_min_elt l v r = + match l with + | Empty -> r + | Node(ll,lv,lr,_) -> bal (remove_min_elt ll lv lr) v r let internal_merge l r = match (l, r) with @@ -71,23 +71,23 @@ let internal_merge l r = | (_, Node (rl,rv,rr,_) ) -> bal l (min_elt rv r) (remove_min_elt rl rv rr) let rec remove x tree = - match tree with + match tree with | Empty -> Empty | Node(l, v, r, _) -> let c = compare_int x v in if c = 0 then internal_merge l r else if c < 0 then bal (remove x l) v r else bal l v (remove x r) -let rec mem x = function +let rec mem x = function | Empty -> false | Node(l, v, r, _) -> let c = compare_int x v in c = 0 || mem x (if c < 0 then l else r) - + let () = - let v = ref Empty in + let v = ref Empty in let iter = 1_00_000 in for i = 0 to iter do v := add i !v @@ -95,10 +95,10 @@ let () = for i = 0 to iter do if not (mem i !v) then print_endline "impossible" - done; + done; for i = 0 to iter do - v := remove i !v + v := remove i !v done; - match !v with + match !v with | Empty -> () | Node _ -> print_endline "impossible" diff --git a/jscomp/test/bdd.ml b/jscomp/test/bdd.ml index 3f4a4a732a..85f09fd0ed 100644 --- a/jscomp/test/bdd.ml +++ b/jscomp/test/bdd.ml @@ -24,8 +24,8 @@ let rec eval bdd vars = | Node(l, v, _, h) -> if vars.(v) then eval h vars else eval l vars -let getId bdd = - match bdd with +let getId bdd = + match bdd with Node(_,_,id,_) -> id | Zero -> 0 | One -> 1 @@ -42,10 +42,10 @@ let resize newSize = let newSz_1 = newSize-1 in let newArr = Array.make newSize [] in let rec copyBucket bucket = - match bucket with + match bucket with [] -> () - | n :: ns -> - match n with + | n :: ns -> + match n with | Node(l,v,_,h) -> let ind = hashVal (getId l) (getId h) v land newSz_1 in @@ -60,7 +60,7 @@ let resize newSize = sz_1 := newSz_1 -let rec insert idl idh v ind bucket newNode = +let insert idl idh v ind bucket newNode = if !n_items <= !sz_1 then ( (!htab).(ind) <- (newNode :: bucket); incr n_items ) @@ -80,18 +80,18 @@ let resetUnique () = ( let mkNode low v high = let idl = getId low in - let idh = getId high + let idh = getId high in if idl = idh then low else let ind = hashVal idl idh v land (!sz_1) in let bucket = (!htab).(ind) in - let rec lookup b = - match b with + let rec lookup b = + match b with [] -> let n = Node(low, v, (incr nodeC; !nodeC), high) in insert (getId low) (getId high) v ind bucket n; n - | n :: ns -> + | n :: ns -> match n with | Node(l,v',id,h) -> if v = v' && idl = getId l && idh = getId h @@ -104,7 +104,7 @@ let mkNode low v high = type ordering = LESS | EQUAL | GREATER let cmpVar (x : int) (y : int) = - if xy then GREATER else EQUAL + if xy then GREATER else EQUAL let zero = Zero let one = One @@ -123,7 +123,7 @@ let notslot1 = Array.make cacheSize 0 let notslot2 = Array.make cacheSize one let hash x y = ((x lsl 1)+y) mod cacheSize -let rec not n = +let rec not n = match n with Zero -> One | One -> Zero @@ -134,9 +134,9 @@ match n with in notslot1.(h) <- id; notslot2.(h) <- f; f -let rec and2 n1 n2 = +let rec and2 n1 n2 = match n1 with - Node(l1, v1, i1, r1) + Node(l1, v1, i1, r1) -> (match n2 with Node(l2, v2, i2, r2) -> let h = hash i1 i2 @@ -147,8 +147,8 @@ match n1 with | LESS -> mkNode (and2 l1 n2) v1 (and2 r1 n2) | GREATER -> mkNode (and2 n1 l2) v2 (and2 n1 r2) in - andslot1.(h) <- i1; - andslot2.(h) <- i2; + andslot1.(h) <- i1; + andslot2.(h) <- i2; andslot3.(h) <- f; f | Zero -> Zero @@ -157,9 +157,9 @@ match n1 with | One -> n2 -let rec xor n1 n2 = +let rec xor n1 n2 = match n1 with - Node(l1, v1, i1, r1) + Node(l1, v1, i1, r1) -> (match n2 with Node(l2, v2, i2, r2) -> let h = hash i1 i2 @@ -174,19 +174,19 @@ match n1 with andslot2.(h) <- i2; andslot3.(h) <- f; f - | Zero -> n1 + | Zero -> n1 | One -> not n1) | Zero -> n2 | One -> not n2 -let hwb n = +let hwb n = let rec h i j = if i=j then mkVar i else xor (and2 (not(mkVar j)) (h i (j-1))) (and2 (mkVar j) (g i (j-1))) and g i j = if i=j then mkVar i - else xor (and2 (not(mkVar i)) (h (i+1) j)) + else xor (and2 (not(mkVar i)) (h (i+1) j)) (and2 (mkVar i) (g (i+1) j)) in h 0 (n-1) @@ -202,12 +202,12 @@ let random_vars n = for i = 0 to n - 1 do vars.(i) <- random() done; vars -let bool_equal a b = +let bool_equal a b = match a, b with - | true, true + | true, true | false, false -> true - | _ -> false + | _ -> false let test_hwb bdd vars = (* We should have @@ -227,7 +227,7 @@ let main () = (* if Array.length Sys.argv >= 3 then int_of_string Sys.argv.(2) else 100 in *) let bdd = hwb n in let succeeded = ref true in - for i = 1 to ntests do + for _i = 1 to ntests do succeeded := !succeeded && test_hwb bdd (random_vars n) done; assert !succeeded diff --git a/jscomp/test/bs_abstract_test.ml b/jscomp/test/bs_abstract_test.ml index 942b228a44..4768deb0b6 100644 --- a/jscomp/test/bs_abstract_test.ml +++ b/jscomp/test/bs_abstract_test.ml @@ -1,6 +1,6 @@ [@@@config {flags = [|"-w";"+unused-type-declaration";"-warn-error"; "A"|]}] -type 'a linked_list = +type[@ocaml.warning "-69"] 'a linked_list = { hd : 'a ; mutable tl : 'a linked_list Js.null @@ -25,7 +25,7 @@ let x1 k = x ~k ~y:"xx" let f = x ~k:(fun[@u] x y -> x = y) ~y:"x" -type u = { +type[@ocaml.warning "-69"] u = { x : int ; y0 : int -> int; y1 : int -> int -> int @@ -36,7 +36,7 @@ let uf u = u |. y0Get 1 let uf1 u = u |. y1Get 1 let uf2 u = u |. y1Get 1 2 -type u1 = { +type[@ocaml.warning "-69"] u1 = { x : int; yyyy : (int -> int [@u]); yyyy1 : (int -> int -> int [@u]); @@ -56,7 +56,7 @@ let uff3 f = -type u3 = { +type[@ocaml.warning "-69"] u3 = { x : int; yyyy : (int -> int [@u]); yyyy1 : (int -> int -> int [@u]); diff --git a/jscomp/test/bs_array_test.ml b/jscomp/test/bs_array_test.ml index 02a4645395..8d64d89c88 100644 --- a/jscomp/test/bs_array_test.ml +++ b/jscomp/test/bs_array_test.ml @@ -1,3 +1,4 @@ +[@@@ocaml.warning "-3"] let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 diff --git a/jscomp/test/bs_hashset_int_test.ml b/jscomp/test/bs_hashset_int_test.ml index cdeb77908b..7835a3fba1 100644 --- a/jscomp/test/bs_hashset_int_test.ml +++ b/jscomp/test/bs_hashset_int_test.ml @@ -1,63 +1,63 @@ let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y -let b loc x = Mt.bool_suites ~test_id ~suites loc x +let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y +let b loc x = Mt.bool_suites ~test_id ~suites loc x module N = Belt.HashSet.Int -module S = Belt.Set.Int +module S = Belt.Set.Int module I = Array_data_util let (++) = Belt.Array.concat -let add = fun x y -> x + y +let add = fun x y -> x + y -let sum2 h = - let v = ref 0 in - N.forEach h (fun x -> v := !v + x) ; - !v -let () = - let u = I.randomRange 30 100 ++ I.randomRange 40 120 in - let v = N.fromArray u in - eq __LOC__ (N.size v) 91 ; - let xs = S.toArray (S.fromArray (N.toArray v)) in +let sum2 h = + let v = ref 0 in + N.forEach h (fun x -> v := !v + x) ; + !v +let () = + let u = I.randomRange 30 100 ++ I.randomRange 40 120 in + let v = N.fromArray u in + eq __LOC__ (N.size v) 91 ; + let xs = S.toArray (S.fromArray (N.toArray v)) in eq __LOC__ xs (I.range 30 120); - let x = ((30 + 120)/2 * 91) in + let x = ((30 + 120)/2 * 91) in eq __LOC__ (N.reduce v 0 add) x ; eq __LOC__ (sum2 v ) x let () = - let u = I.randomRange 0 100_000 ++ I.randomRange 0 100 in - let v = N.make 40 in + let u = I.randomRange 0 100_000 ++ I.randomRange 0 100 in + let v = N.make ~hintSize:40 in N.mergeMany v u ; eq __LOC__ (N.size v) 100_001; - for i = 0 to 1_000 do - N.remove v i - done ; + for i = 0 to 1_000 do + N.remove v i + done ; eq __LOC__ (N.size v ) 99_000; - for i = 0 to 2_000 do - N.remove v i - done ; + for i = 0 to 2_000 do + N.remove v i + done ; eq __LOC__ (N.size v ) 98_000 module A = Belt.Array module SI = Belt.SortArray.Int -let () = - let u0 = N.fromArray (I.randomRange 0 100_000) in - let u1 = N.copy u0 in +let () = + let u0 = N.fromArray (I.randomRange 0 100_000) in + let u1 = N.copy u0 in eq __LOC__ (N.toArray u0) (N.toArray u1); - for i = 0 to 2000 do - N.remove u1 i - done ; - for i = 0 to 1000 do - N.remove u0 i + for i = 0 to 2000 do + N.remove u1 i + done ; + for i = 0 to 1000 do + N.remove u0 i done ; - let v0 = (A.concat (I.range 0 1000) (N.toArray u0)) in - let v1 = (A.concat (I.range 0 2000) (N.toArray u1)) in - SI.stableSortInPlace v0; + let v0 = (A.concat (I.range 0 1000) (N.toArray u0)) in + let v1 = (A.concat (I.range 0 2000) (N.toArray u1)) in + SI.stableSortInPlace v0; SI.stableSortInPlace v1; - eq __LOC__ v0 v1 - + eq __LOC__ v0 v1 + let () = - let h = N.fromArray (I.randomRange 0 1_000_000) in - let histo = N.getBucketHistogram h in + let h = N.fromArray (I.randomRange 0 1_000_000) in + let histo = N.getBucketHistogram h in b __LOC__ (A.length histo <= 10) let () = Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/bs_map_set_dict_test.ml b/jscomp/test/bs_map_set_dict_test.ml index d4c68ab681..6bf95699e1 100644 --- a/jscomp/test/bs_map_set_dict_test.ml +++ b/jscomp/test/bs_map_set_dict_test.ml @@ -5,7 +5,7 @@ let b loc v = Mt.bool_suites ~suites ~test_id loc v module Icmp = (val Belt.Id.comparable - (fun (x : int) y -> + ~cmp:(fun (x : int) y -> compare x y ) ) @@ -13,7 +13,7 @@ module Icmp2 = (val Belt.Id.comparable ~cmp:(fun (x : int) y -> compare x y )) -module Ic3 = +module Ic3 = (val Belt.Id.comparable ~cmp:(compare : int -> int -> int)) module M = Belt.Map @@ -22,15 +22,15 @@ module MI = Belt.Map.Int module I = Array_data_util module A = Belt.Array module L = Belt.List -let m0 : (_,string,_) M.t = M.make (module Icmp) +let m0 : (_,string,_) M.t = M.make ~id:(module Icmp) -let m00 = Belt.Set.make (module Ic3) +let m00 = Belt.Set.make ~id:(module Ic3) module I2 = (val Belt.Id.comparable ~cmp:(fun (x : int) y -> compare y x )) -let m = M.make (module Icmp2) -let m2 : (int, string, _) M.t = M.make (module I2) +let m = M.make ~id:(module Icmp2) +let m2 : (int, string, _) M.t = M.make ~id:(module I2) let vv = MI.empty let vv2 = MI.empty module Md0 = Belt.Map.Dict @@ -55,13 +55,13 @@ let () = Md0.set ~cmp:Icmp.cmp m 1 1 in - let _m20 = M.make (module Icmp) in + let _m20 = M.make ~id:(module Icmp) in Js.log m11 module S0 = Belt.Set.Dict let () = let count = 100_000 in - let v = ISet.make (module Icmp2) in + let v = ISet.make ~id:(module Icmp2) in let m_dict = M.getId m in let module M = (val m_dict) in let cmp = M.cmp in diff --git a/jscomp/test/bs_map_test.ml b/jscomp/test/bs_map_test.ml index 29d246b5df..6cfae4bd44 100644 --- a/jscomp/test/bs_map_test.ml +++ b/jscomp/test/bs_map_test.ml @@ -1,14 +1,14 @@ let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = - incr test_id ; - suites := +let eq loc x y = + incr test_id ; + suites := (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites -let b loc v = - incr test_id ; - suites := - (loc ^" id " ^ (string_of_int !test_id), +let b loc v = + incr test_id ; + suites := + (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Ok v)) :: !suites module M = Belt.Map.Int @@ -16,18 +16,18 @@ module N = Belt.Set.Int module A = Belt.Array -let mapOfArray x = M.fromArray x -let setOfArray x = N.fromArray x -let emptyMap () = M.empty +let mapOfArray x = M.fromArray x +let setOfArray x = N.fromArray x +let emptyMap () = M.empty -let () = - let v = - (A.makeByAndShuffle 1_000_000 (fun i -> (i,i))) in - let u = M.fromArray v in +let () = + let v = + (A.makeByAndShuffle 1_000_000 (fun i -> (i,i))) in + let u = M.fromArray v in (M.checkInvariantInternal u); - let firstHalf = A.slice v 0 2_000 in + let firstHalf = A.slice v ~offset:0 ~len:2_000 in let xx = A.reduce firstHalf u - (fun acc (x,_) -> M.remove acc x) in + (fun acc (x,_) -> M.remove acc x) in (M.checkInvariantInternal u); (M.checkInvariantInternal xx); diff --git a/jscomp/test/bs_poly_map_test.ml b/jscomp/test/bs_poly_map_test.ml index 9c07f90a28..10383caa88 100644 --- a/jscomp/test/bs_poly_map_test.ml +++ b/jscomp/test/bs_poly_map_test.ml @@ -16,7 +16,7 @@ module I = Array_data_util let mapOfArray x = M.fromArray ~id:(module Icmp) x let setOfArray x = N.fromArray ~id:(module Icmp) x -let emptyMap () = M.make (module Icmp) +let emptyMap () = M.make ~id:(module Icmp) let mergeInter s1 s2 = setOfArray @@ M.keysToArray (M.merge s1 s2 (fun k v1 v2 -> diff --git a/jscomp/test/bs_poly_set_test.ml b/jscomp/test/bs_poly_set_test.ml index 5df0b61f93..35b6a49f89 100644 --- a/jscomp/test/bs_poly_set_test.ml +++ b/jscomp/test/bs_poly_set_test.ml @@ -86,10 +86,10 @@ let () = b __LOC__ (None = (N.get u22 59)); eq __LOC__ (N.size u25) 60; - b __LOC__ (N.minimum (N.make (module IntCmp)) = None); - b __LOC__ (N.maximum (N.make (module IntCmp)) = None); - b __LOC__ (N.minUndefined (N.make (module IntCmp)) = Js.undefined); - b __LOC__ (N.maxUndefined (N.make (module IntCmp)) = Js.undefined) + b __LOC__ (N.minimum (N.make ~id:(module IntCmp)) = None); + b __LOC__ (N.maximum (N.make ~id:(module IntCmp)) = None); + b __LOC__ (N.minUndefined (N.make ~id:(module IntCmp)) = Js.undefined); + b __LOC__ (N.maxUndefined (N.make ~id:(module IntCmp)) = Js.undefined) let testIterToList xs = diff --git a/jscomp/test/bs_set_int_test.ml b/jscomp/test/bs_set_int_test.ml index d1e7e8da75..540928fcff 100644 --- a/jscomp/test/bs_set_int_test.ml +++ b/jscomp/test/bs_set_int_test.ml @@ -1,115 +1,115 @@ [@@@warning "-44"] let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = Mt.eq_suites ~suites ~test_id loc x y +let eq loc x y = Mt.eq_suites ~suites ~test_id loc x y -let b loc v = Mt.bool_suites ~suites ~test_id loc v +let b loc v = Mt.bool_suites ~suites ~test_id loc v module N = Belt.Set.Int module I = Array_data_util module A = Belt.Array -let (=~) s i = +let (=~) s i = N.(eq (fromArray i) s) -let (=*) a b = +let (=*) a b = N.(eq (fromArray a) (fromArray b)) let ofA = N.fromArray -let ()= - b __LOC__ +let ()= + b __LOC__ ([|1;2;3|] =* [|3;2;1|]) let u = N.(intersect (ofA [|1;2;3|]) (ofA [|3;4;5|]) ) -let ()= - b __LOC__ +let ()= + b __LOC__ (u =~ [|3|]) (* inclusive *) -let range i j = +let range i j = Array.init (j - i + 1) (fun k -> k + i ) -let revRange i j = - Array.init (j - i + 1) (fun k -> k + i ) |> Array.to_list |> List.rev |> Array.of_list +let revRange i j = + Array.init (j - i + 1) (fun k -> k + i ) |> Array.to_list |> List.rev |> Array.of_list -let () = - let v = (ofA (Array.append (range 100 1000) (revRange 400 1500))) in +let () = + let v = (ofA (Array.append (range 100 1000) (revRange 400 1500))) in b __LOC__ (v =~ (range 100 1500)); - let l, r = N.partition v (fun x -> x mod 3 = 0) in - let nl, nr = - let l,r = ref N.empty, ref N.empty in - for i = 100 to 1500 do - if i mod 3 = 0 then + let l, r = N.partition v (fun x -> x mod 3 = 0) in + let nl, nr = + let l,r = ref N.empty, ref N.empty in + for i = 100 to 1500 do + if i mod 3 = 0 then l := N.add !l i - else + else r := N.add !r i - done; - !l, !r in + done; + !l, !r in b __LOC__ (N.eq l nl); - b __LOC__ (N.eq r nr) - -let () = + b __LOC__ (N.eq r nr) + +let () = b __LOC__ (N.(intersect (ofA (range 1 100)) (ofA (range 50 200)) ) =~ range 50 100) -let () = +let () = b __LOC__ (N.(union (ofA (range 1 100)) (ofA (range 50 200)) ) =~ range 1 200) let () = b __LOC__ (N.(diff (ofA (range 1 100)) (ofA (range 50 200)) ) =~ range 1 49) -let () = +let () = b __LOC__ (N.(intersect (ofA (revRange 1 100)) (ofA (revRange 50 200)) ) =~ revRange 50 100) -let () = +let () = b __LOC__ (N.(union (ofA (revRange 1 100)) (ofA (revRange 50 200)) ) =~ revRange 1 200) let () = b __LOC__ (N.(diff (ofA (revRange 1 100)) (ofA (revRange 50 200)) ) =~ revRange 1 49) - -let () = - let ss = [|1;222;3;4;2;0;33;-1|] in - let v = ofA [|1;222;3;4;2;0;33;-1|] in - let minv, maxv = N.minUndefined v, N.maxUndefined v in - let approx loc (x : int) y = - b loc (Js.eqUndefined x y) in + +let () = + let ss = [|1;222;3;4;2;0;33;-1|] in + let v = ofA [|1;222;3;4;2;0;33;-1|] in + let minv, maxv = N.minUndefined v, N.maxUndefined v in + let approx loc (x : int) y = + b loc (Js.eqUndefined x y) in eq __LOC__ (N.reduce v 0 (fun x y -> x + y) ) (A.reduce ss 0 (+) ) ; approx __LOC__ (-1) minv ; approx __LOC__ 222 maxv; - let v = N.remove v 3 in - let minv, maxv = N.minimum v, N.maximum v in - eq __LOC__ minv (Some (-1)); + let v = N.remove v 3 in + let minv, maxv = N.minimum v, N.maximum v in + eq __LOC__ minv (Some (-1)); eq __LOC__ maxv (Some 222); - let v = N.remove v 222 in - let minv, maxv = N.minimum v, N.maximum v in - eq __LOC__ minv (Some (-1)); + let v = N.remove v 222 in + let minv, maxv = N.minimum v, N.maximum v in + eq __LOC__ minv (Some (-1)); eq __LOC__ maxv (Some 33); - let v = N.remove v (-1) in - let minv, maxv = N.minimum v, N.maximum v in - eq __LOC__ minv (Some (0)); + let v = N.remove v (-1) in + let minv, maxv = N.minimum v, N.maximum v in + eq __LOC__ minv (Some (0)); eq __LOC__ maxv (Some 33); - let v = N.remove v 0 in - let v = N.remove v 33 in - let v = N.remove v 2 in - let v = N.remove v 3 in - let v = N.remove v 4 in - let v = N.remove v 1 in + let v = N.remove v 0 in + let v = N.remove v 33 in + let v = N.remove v 2 in + let v = N.remove v 3 in + let v = N.remove v 4 in + let v = N.remove v 1 in b __LOC__ (N.isEmpty v ) - -let () = - let count = 1_000_000 in - let v = ((A.makeByAndShuffle count (fun i -> i))) in - let u = N.fromArray v in + +let () = + let count = 1_000_000 in + let v = ((A.makeByAndShuffle count (fun i -> i))) in + let u = N.fromArray v in (N.checkInvariantInternal u ); - let firstHalf = A.slice v 0 2_000 in - let xx = Belt.Array.reduce firstHalf u N.remove in + let firstHalf = A.slice v ~offset:0 ~len:2_000 in + let xx = Belt.Array.reduce firstHalf u N.remove in (N.checkInvariantInternal u); b __LOC__ N.(eq (union (fromArray firstHalf) xx) u) - -let () = + +let () = let aa = N.fromArray (I.randomRange 0 100) in - let bb = N.fromArray (I.randomRange 0 200) in - let cc = N.fromArray (I.randomRange 120 200) in - let dd = N.union aa cc in + let bb = N.fromArray (I.randomRange 0 200) in + let cc = N.fromArray (I.randomRange 120 200) in + let dd = N.union aa cc in b __LOC__ (N.subset aa bb); b __LOC__ (N.subset dd bb); b __LOC__ (N.subset (N.add dd 200) bb); @@ -118,60 +118,60 @@ let () = b __LOC__ (not (N.subset (N.add dd 201) bb)) -let () = - let aa = N.fromArray (I.randomRange 0 100) in - let bb = N.fromArray (I.randomRange 0 100) in - let cc = N.add bb 101 in - let dd = N.remove bb 99 in - let ee = N.add dd 101 in +let () = + let aa = N.fromArray (I.randomRange 0 100) in + let bb = N.fromArray (I.randomRange 0 100) in + let cc = N.add bb 101 in + let dd = N.remove bb 99 in + let ee = N.add dd 101 in b __LOC__ (N.eq aa bb ); b __LOC__ (not (N.eq aa cc)); b __LOC__ (not (N.eq dd cc)); b __LOC__ (not (N.eq bb ee)) -let () = - let a0 = N.empty in - let a1 = N.mergeMany a0 (I.randomRange 0 100) in - let a2 = N.removeMany a1 (I.randomRange 40 100) in - let a3 = N.fromArray (I.randomRange 0 39) in - let (a4,a5), pres = N.split a1 40 in +let () = + let a0 = N.empty in + let a1 = N.mergeMany a0 (I.randomRange 0 100) in + let a2 = N.removeMany a1 (I.randomRange 40 100) in + let a3 = N.fromArray (I.randomRange 0 39) in + let (a4,a5), pres = N.split a1 40 in b __LOC__ (N.eq a1 (N.fromArray (I.randomRange 0 100))); b __LOC__ (N.eq a2 a3); b __LOC__ pres; b __LOC__ (N.eq a3 a4); - let a6 = N.remove (N.removeMany a1 (I.randomRange 0 39)) 40 in + let a6 = N.remove (N.removeMany a1 (I.randomRange 0 39)) 40 in b __LOC__ (N.eq a5 a6); - let a7 = N.remove a1 40 in - let (a8,a9), pres2 = N.split a7 40 in - b __LOC__ (not pres2); + let a7 = N.remove a1 40 in + let (a8,a9), pres2 = N.split a7 40 in + b __LOC__ (not pres2); b __LOC__ (N.eq a4 a8); b __LOC__ (N.eq a5 a9); - let a10 = N.removeMany a9 (I.randomRange 42 2000) in - eq __LOC__ (N.size a10 ) 1; - let a11 = N.removeMany a9 (I.randomRange 0 2000) in + let a10 = N.removeMany a9 (I.randomRange 42 2000) in + eq __LOC__ (N.size a10 ) 1; + let a11 = N.removeMany a9 (I.randomRange 0 2000) in b __LOC__ (N.isEmpty a11) -let () = - let (aa,bb), pres = N.split N.empty 0 in +let () = + let (aa,bb), pres = N.split N.empty 0 in b __LOC__ (N.isEmpty aa); b __LOC__ (N.isEmpty bb); - b __LOC__ (not pres) - -let () = - let v = N.fromArray (I.randomRange 0 2_000) in - let v0 = N.fromArray (I.randomRange 0 2_000) in - let v1 = N.fromArray (I.randomRange 1 2_001) in - let v2 = N.fromArray (I.randomRange 3 2_002) in - let v3 = N.removeMany v2 [|2_002; 2_001|] in - let us = A.map (I.randomRange 1_000 3_000) (fun x -> N.has v x) in - let counted = A.reduce us 0 (fun acc x -> if x then acc + 1 else acc ) in - eq __LOC__ counted 1_001 ; - b __LOC__ (N.eq v v0) ; + b __LOC__ (not pres) + +let () = + let v = N.fromArray (I.randomRange 0 2_000) in + let v0 = N.fromArray (I.randomRange 0 2_000) in + let v1 = N.fromArray (I.randomRange 1 2_001) in + let v2 = N.fromArray (I.randomRange 3 2_002) in + let v3 = N.removeMany v2 [|2_002; 2_001|] in + let us = A.map (I.randomRange 1_000 3_000) (fun x -> N.has v x) in + let counted = A.reduce us 0 (fun acc x -> if x then acc + 1 else acc ) in + eq __LOC__ counted 1_001 ; + b __LOC__ (N.eq v v0) ; b __LOC__ (N.cmp v v0 = 0); - b __LOC__ (N.cmp v v1 < 0); + b __LOC__ (N.cmp v v1 < 0); b __LOC__ (N.cmp v v2 > 0); b __LOC__ (N.subset v3 v0); b __LOC__ (not (N.subset v1 v0)); eq __LOC__ (N.get v 30 ) (Some 30); eq __LOC__ (N.get v 3_000 ) None -;; Mt.from_pair_suites __MODULE__ !suites +;; Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/caml_compare_test.ml b/jscomp/test/caml_compare_test.ml index a5cea21c03..90d1ce6dfc 100644 --- a/jscomp/test/caml_compare_test.ml +++ b/jscomp/test/caml_compare_test.ml @@ -1,7 +1,7 @@ [@@@warning "-45"] type u = A of int | B of int * bool | C of int -let function_equal_test = try ((fun x -> x + 1) = (fun x -> x + 2)) with +let[@ocaml.warning "-52"] function_equal_test = try ((fun x -> x + 1) = (fun x -> x + 2)) with | Invalid_argument "equal: functional value" -> true | _ -> false diff --git a/jscomp/test/caml_format_test.ml b/jscomp/test/caml_format_test.ml index 37fa9fe3c3..88dd6773f5 100644 --- a/jscomp/test/caml_format_test.ml +++ b/jscomp/test/caml_format_test.ml @@ -1,5 +1,5 @@ [@@@warning "-107"] -let of_string = +let of_string = [| (0, "0"); (3, "03"); (-3, "-03"); (-63, "-0x3f"); (-31, "-0x1f"); (47, "0X2f"); (11, "0O13"); (8, "0o10"); (3, "0b11"); (1, "0b01"); (0, "0b00"); (-3, "-0b11"); (-5, "-0B101"); (332, "0332"); (-32, "-32"); @@ -13,72 +13,72 @@ let of_string = (* "0.", 0. *) (* |] *) -let from_float_of_string xs = - xs - |> Array.mapi (fun i (a,b) -> +let from_float_of_string xs = + xs + |> Array.mapi (fun i (a,b) -> string_of_float ) -let from_of_string xs = - of_string - |> Array.mapi (fun i (a,b) -> +let from_of_string xs = + of_string + |> Array.mapi (fun i (a,b) -> (Printf.sprintf "of_string %L" i), fun _ -> Mt.Eq(int_of_string b,a )) - |> Array.to_list + |> Array.to_list -let u v = Printf.sprintf "%33d" v +let u v = Printf.sprintf "%33d" v let to_str s = int_of_string s let v = Printf.sprintf "%3d" 3333 external format_int : string -> int -> string = "caml_format_int" -let suites : Mt.pair_suites = +let suites : Mt.pair_suites = from_of_string of_string @ - ["isnan_of_string", (fun _ -> + ["isnan_of_string", (fun _ -> Mt.Eq (true,classify_float( float_of_string "nan") = FP_nan))] @ (let pairs = [| FP_infinite, "infinity"; - FP_infinite, "+infinity"; + FP_infinite, "+infinity"; FP_infinite, "-infinity"; FP_zero, "0"; FP_zero, "0." - |] - in - pairs - |> Array.mapi + |] + in + pairs + |> Array.mapi (fun i (a,b) -> (Printf.sprintf "infinity_of_string %d" i ), (fun _ -> Mt.Eq(a, - classify_float @@ float_of_string b))) - |> Array.to_list ) @ + classify_float @@ float_of_string b))) + |> Array.to_list ) @ [ "throw", (fun _ -> Mt.ThrowAny (fun _ -> ignore @@ float_of_string "")); - "format_int", (fun _ -> + "format_int", (fun _ -> Mt.Eq(" 33", format_int "%32d" 33)) ] @ (let pairs = [| 3232., "32_32.0"; 1.000, "1.000"; 12.000, "12.000" - |] - in - pairs - |> Array.mapi + |] + in + pairs + |> Array.mapi (fun i (a,b) -> (Printf.sprintf "normal_float_of_string %d" i ), (fun _ -> Mt.Eq(a, - float_of_string b))) - |> Array.to_list ) + float_of_string b))) + |> Array.to_list ) let ( ^^ ) (Format (fmt1, str1) : _ format6) (Format (fmt2, str2) : _ format6) : _ format6 = Format (CamlinternalFormatBasics.concat_fmt fmt1 fmt2, str1 ^ "%," ^ str2) - + let ff = format_int "%32d" let a = Format.asprintf let formatter_suites = Mt.[ - "fmt_concat", + "fmt_concat", (fun _ -> Eq (Format.asprintf ("%s %03d %L" ^^ "%S %03d %L" ) "32" 33 33 "a" 33 3, "32 033 33\"a\" 033 3")); "fmt_gen", (fun _ -> Eq(Format.asprintf ("%s %03d %L" ^^ "%S %03d %L %a" ) "32" 33 33 "a" 33 3 (Format.pp_print_list Format.pp_print_int) [1;2;3], "32 033 33\"a\" 033 3 12\n3")); @@ -107,7 +107,7 @@ external format_float: string -> float -> string (* ("%3.10f", 3e+56, *) (* "300000000000000005792779041490073052596128503513888063488.0000000000"); *) -let float_data = +let float_data = [|("%f", 32., "32.000000"); ("%f", nan, "nan"); ("%f", infinity, "inf"); ("%f", neg_infinity, "-inf"); ("%1.e", 13000., "1e+04"); ("%1.3e", 2.3e-05, "2.300e-05"); ("%3.10e", 3e+56, "3.0000000000e+56"); @@ -119,10 +119,10 @@ let float_data = ("%3.0g", 30000000000., "3e+10"); ("%3.g", 30000000000., "3e+10"); ("%3.g", 3., " 3"); ("%1.1g", 2.1, "2"); ("%1.2g", 2.1, "2.1")|] -let float_suites = Mt.[ +let float_suites = [ "float_nan" ] -module Lambda_suites = struct +module Lambda_suites = struct open Format;; let ident ppf s = fprintf ppf "%s" s;; @@ -152,7 +152,7 @@ module Lambda_suites = struct let string_of_lambda = Format.asprintf "%a" pr_lambda end -let lambda_suites = +let lambda_suites = [|(Lambda_suites.Var "x", "x"); (Lambda_suites.Apply (Lambda_suites.Var "x", Lambda_suites.Var "y"), "x y"); (Lambda_suites.Lambda ("z", @@ -163,8 +163,8 @@ let lambda_suites = Lambda_suites.Apply (Lambda_suites.Var "x", Lambda_suites.Var "y"))), "\\z. \\z. x y")|] -let from_lambda_pairs p = - lambda_suites +let from_lambda_pairs p = + lambda_suites |> Array.mapi (fun i (a,b) -> Printf.sprintf "lambda_print %d" i, (fun _ -> Mt.Eq(Lambda_suites.string_of_lambda a, b))) |> Array.to_list @@ -176,7 +176,7 @@ let ksprintf_suites = Mt.[ (* module Mt = Mock_mt *) -let int64_suites = +let int64_suites = let a = Format.asprintf in Mt.[ @@ -189,9 +189,9 @@ let int64_suites = "i64_simple4", (fun _ -> Eq(a "%LX" 44L, "2C")); "i64_simple5", (fun _ -> Eq(a "%Lx" 44L, "2c")); "i64_simple6", (fun _ -> Eq(a "%*Lx" 5 44L, " 2c")); - "i64_simple7", (fun _ -> Eq(Int64.to_string 3333L, "3333")); + "i64_simple7", (fun _ -> Eq(Int64.to_string 3333L, "3333")); "i64_simple8", (fun _ -> Eq( a "%Ld%018Ld" 3L 3L, "3000000000000000003")); - "i64_simple9", (fun _ -> Eq( a "%Ld%018Ld" 460800000000000L 0L, + "i64_simple9", (fun _ -> Eq( a "%Ld%018Ld" 460800000000000L 0L, "460800000000000000000000000000000")); "i64_simple10", (fun _ -> Eq( a "%Lx" Int64.max_int,"7fffffffffffffff" )); @@ -217,21 +217,21 @@ let int64_suites = Eq(a "%Lu" (-1L), "18446744073709551615") ); - __LOC__, (fun _ -> + __LOC__, (fun _ -> Eq (a "%Lu" (-100L), "18446744073709551516") - ) ; + ) ; __LOC__, (fun _ -> Eq (a "%Lu" Int64.(add min_int 1L), "9223372036854775809") ); - __LOC__, (fun _ -> Eq(a "%Lu" (-10000L), "18446744073709541616")); + __LOC__, (fun _ -> Eq(a "%Lu" (-10000L), "18446744073709541616")); "i64_simple19", (fun _ -> Eq(a "%Lo" Int64.min_int , "1000000000000000000000") ); "i64_simple13", (fun _ -> Eq( a "%LX" Int64.(add min_int 1L), "8000000000000001")); - + "i64_simple20", (fun _ -> Eq(a "%12Lx" 3L, " 3")); "i64_simple21", (fun _ -> Eq(a "%LX" 7985179176134664640L, "6ED10E27455A61C0")); "missing_neline", (fun _ -> Eq(Format.asprintf "%Ld\n" 32L, "32\n")); - "missing_newline2", (fun _ -> + "missing_newline2", (fun _ -> Eq((let buf = Buffer.create 30 in Printf.bprintf buf "%Ld\n" 32L; Buffer.contents buf), "32\n" )) @@ -250,7 +250,7 @@ let of_string_data = (113L, "0b01110001"); (1L, "-0xffff_ffff_ffff_ffff") |] - + (* module Mt = Mock_mt *) let () = @@ -260,14 +260,13 @@ let () = from_lambda_pairs lambda_suites @ ksprintf_suites @ (Array.mapi (fun i (fmt, f,str_result) -> (Printf.sprintf "float_format %d" i ) , (fun _ -> Mt.Eq(format_float fmt f, str_result))) float_data |> Array.to_list) @ - + int64_suites @ (of_string_data |> Array.mapi (fun i (a,b) -> - ((Printf.sprintf "int64_of_string %d " i), fun _ -> Mt.Eq(Int64.of_string b, a) ) - ) + ((Printf.sprintf "int64_of_string %d " i), fun _ -> Mt.Eq(Int64.of_string b, a) ) + ) |> Array.to_list ) - diff --git a/jscomp/test/derive_projector_test.ml b/jscomp/test/derive_projector_test.ml index 3a4d4b29aa..8a7a55ef7d 100644 --- a/jscomp/test/derive_projector_test.ml +++ b/jscomp/test/derive_projector_test.ml @@ -1,4 +1,4 @@ -[@@@warning "-104"] +[@@@warning "-30-104"] type a = { u_x : int} [@@deriving accessors ] @@ -22,7 +22,6 @@ and u = | Hei and h = {d : d ; h : h list; u_X : int} and e = { d : d } - [@@deriving accessors] diff --git a/jscomp/test/dist/jscomp/test/bdd.js b/jscomp/test/dist/jscomp/test/bdd.js index 15b2fa26a4..d2c35cf05f 100644 --- a/jscomp/test/dist/jscomp/test/bdd.js +++ b/jscomp/test/dist/jscomp/test/bdd.js @@ -368,7 +368,7 @@ function test_hwb(bdd, vars) { function main(param) { var bdd = hwb(22); var succeeded = true; - for(var i = 1; i <= 100; ++i){ + for(var _i = 1; _i <= 100; ++_i){ succeeded = succeeded && test_hwb(bdd, random_vars(22)); } if (succeeded) { diff --git a/jscomp/test/dist/jscomp/test/bs_array_test.js b/jscomp/test/dist/jscomp/test/bs_array_test.js index 0ebbd4d40f..61a73b84b1 100644 --- a/jscomp/test/dist/jscomp/test/bs_array_test.js +++ b/jscomp/test/dist/jscomp/test/bs_array_test.js @@ -70,7 +70,7 @@ var v = [ 2 ]; -eq("File \"jscomp/test/bs_array_test.ml\", line 28, characters 5-12", [ +eq("File \"jscomp/test/bs_array_test.ml\", line 29, characters 5-12", [ Belt__Belt_Array.get(v, 0), Belt__Belt_Array.get(v, 1), Belt__Belt_Array.get(v, 2), @@ -84,14 +84,14 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 28, characters 5-12", [ undefined ]); -$$throw("File \"jscomp/test/bs_array_test.ml\", line 31, characters 8-15", (function (param) { +$$throw("File \"jscomp/test/bs_array_test.ml\", line 32, characters 8-15", (function (param) { Belt__Belt_Array.getExn([ 0, 1 ], -1); })); -$$throw("File \"jscomp/test/bs_array_test.ml\", line 32, characters 8-15", (function (param) { +$$throw("File \"jscomp/test/bs_array_test.ml\", line 33, characters 8-15", (function (param) { Belt__Belt_Array.getExn([ 0, 1 @@ -107,7 +107,7 @@ function f(param) { return Belt__Belt_Array.getExn(partial_arg, param); } -b("File \"jscomp/test/bs_array_test.ml\", line 33, characters 4-11", Caml_obj.caml_equal([ +b("File \"jscomp/test/bs_array_test.ml\", line 34, characters 4-11", Caml_obj.caml_equal([ Curry._1(f, 0), Curry._1(f, 1) ], [ @@ -115,21 +115,21 @@ b("File \"jscomp/test/bs_array_test.ml\", line 33, characters 4-11", Caml_obj.ca 1 ])); -$$throw("File \"jscomp/test/bs_array_test.ml\", line 34, characters 8-15", (function (param) { +$$throw("File \"jscomp/test/bs_array_test.ml\", line 35, characters 8-15", (function (param) { Belt__Belt_Array.setExn([ 0, 1 ], -1, 0); })); -$$throw("File \"jscomp/test/bs_array_test.ml\", line 35, characters 8-15", (function (param) { +$$throw("File \"jscomp/test/bs_array_test.ml\", line 36, characters 8-15", (function (param) { Belt__Belt_Array.setExn([ 0, 1 ], 2, 0); })); -b("File \"jscomp/test/bs_array_test.ml\", line 36, characters 4-11", !Belt__Belt_Array.set([ +b("File \"jscomp/test/bs_array_test.ml\", line 37, characters 4-11", !Belt__Belt_Array.set([ 1, 2 ], 2, 0)); @@ -144,14 +144,14 @@ if (!Belt__Belt_Array.set(v$1, 0, 0)) { RE_EXN_ID: "Assert_failure", _1: [ "jscomp/test/bs_array_test.ml", - 37, + 38, 33 ], Error: new Error() }; } -b("File \"jscomp/test/bs_array_test.ml\", line 37, characters 4-11", Belt__Belt_Array.getExn(v$1, 0) === 0); +b("File \"jscomp/test/bs_array_test.ml\", line 38, characters 4-11", Belt__Belt_Array.getExn(v$1, 0) === 0); var v$2 = [ 1, @@ -163,34 +163,34 @@ if (!Belt__Belt_Array.set(v$2, 1, 0)) { RE_EXN_ID: "Assert_failure", _1: [ "jscomp/test/bs_array_test.ml", - 38, + 39, 32 ], Error: new Error() }; } -b("File \"jscomp/test/bs_array_test.ml\", line 38, characters 4-11", Belt__Belt_Array.getExn(v$2, 1) === 0); +b("File \"jscomp/test/bs_array_test.ml\", line 39, characters 4-11", Belt__Belt_Array.getExn(v$2, 1) === 0); var v$3 = [ 1, 2 ]; -b("File \"jscomp/test/bs_array_test.ml\", line 39, characters 4-11", (Belt__Belt_Array.setExn(v$3, 0, 0), Belt__Belt_Array.getExn(v$3, 0) === 0)); +b("File \"jscomp/test/bs_array_test.ml\", line 40, characters 4-11", (Belt__Belt_Array.setExn(v$3, 0, 0), Belt__Belt_Array.getExn(v$3, 0) === 0)); var v$4 = [ 1, 2 ]; -b("File \"jscomp/test/bs_array_test.ml\", line 40, characters 4-11", (Belt__Belt_Array.setExn(v$4, 1, 0), Belt__Belt_Array.getExn(v$4, 1) === 0)); +b("File \"jscomp/test/bs_array_test.ml\", line 41, characters 4-11", (Belt__Belt_Array.setExn(v$4, 1, 0), Belt__Belt_Array.getExn(v$4, 1) === 0)); function id(x) { - eq("File \"jscomp/test/bs_array_test.ml\", line 43, characters 5-12", Js__Js_vector.toList(Js__Js_list.toVector(x)), x); + eq("File \"jscomp/test/bs_array_test.ml\", line 44, characters 5-12", Js__Js_vector.toList(Js__Js_list.toVector(x)), x); } -eq("File \"jscomp/test/bs_array_test.ml\", line 47, characters 5-12", Js__Js_list.toVector({ +eq("File \"jscomp/test/bs_array_test.ml\", line 48, characters 5-12", Js__Js_list.toVector({ hd: 1, tl: { hd: 2, @@ -205,7 +205,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 47, characters 5-12", Js__Js_lis 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 48, characters 6-13", Js__Js_vector.map((function (x) { +eq("File \"jscomp/test/bs_array_test.ml\", line 49, characters 6-13", Js__Js_vector.map((function (x) { return x + 1 | 0; }), [ 1, @@ -217,7 +217,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 48, characters 6-13", Js__Js_vec 4 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 51, characters 5-12", Caml_array.make(5, 3), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 52, characters 5-12", Caml_array.make(5, 3), [ 3, 3, 3, @@ -229,7 +229,7 @@ var a = Js__Js_vector.init(5, (function (i) { return i + 1 | 0; })); -eq("File \"jscomp/test/bs_array_test.ml\", line 53, characters 5-12", (Js__Js_vector.filterInPlace((function (j) { +eq("File \"jscomp/test/bs_array_test.ml\", line 54, characters 5-12", (Js__Js_vector.filterInPlace((function (j) { return j % 2 === 0; }), a), a), [ 2, @@ -240,7 +240,7 @@ var a$1 = Js__Js_vector.init(5, (function (i) { return i + 1 | 0; })); -eq("File \"jscomp/test/bs_array_test.ml\", line 60, characters 5-12", (Js__Js_vector.filterInPlace((function (j) { +eq("File \"jscomp/test/bs_array_test.ml\", line 61, characters 5-12", (Js__Js_vector.filterInPlace((function (j) { return j % 2 !== 0; }), a$1), a$1), [ 1, @@ -248,7 +248,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 60, characters 5-12", (Js__Js_ve 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 67, characters 5-12", Js__Js_list.toVector({ +eq("File \"jscomp/test/bs_array_test.ml\", line 68, characters 5-12", Js__Js_list.toVector({ hd: 1, tl: { hd: 2, @@ -263,7 +263,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 67, characters 5-12", Js__Js_lis 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 69, characters 5-12", Js__Js_list.toVector({ +eq("File \"jscomp/test/bs_array_test.ml\", line 70, characters 5-12", Js__Js_list.toVector({ hd: 1, tl: /* [] */0 }), [1]); @@ -306,29 +306,29 @@ var v$5 = Belt__Belt_Array.makeBy(3000, (function (i) { var u = Belt__Belt_Array.shuffle(v$5); -neq("File \"jscomp/test/bs_array_test.ml\", line 80, characters 6-13", u, v$5); +neq("File \"jscomp/test/bs_array_test.ml\", line 81, characters 6-13", u, v$5); -eq("File \"jscomp/test/bs_array_test.ml\", line 82, characters 5-12", Belt__Belt_Array.reduce(u, 0, add), Belt__Belt_Array.reduce(v$5, 0, add)); +eq("File \"jscomp/test/bs_array_test.ml\", line 83, characters 5-12", Belt__Belt_Array.reduce(u, 0, add), Belt__Belt_Array.reduce(v$5, 0, add)); -b("File \"jscomp/test/bs_array_test.ml\", line 87, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(0, 3), [ +b("File \"jscomp/test/bs_array_test.ml\", line 88, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(0, 3), [ 0, 1, 2, 3 ])); -b("File \"jscomp/test/bs_array_test.ml\", line 88, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(3, 0), [])); +b("File \"jscomp/test/bs_array_test.ml\", line 89, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(3, 0), [])); -b("File \"jscomp/test/bs_array_test.ml\", line 89, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(3, 3), [3])); +b("File \"jscomp/test/bs_array_test.ml\", line 90, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.range(3, 3), [3])); -b("File \"jscomp/test/bs_array_test.ml\", line 91, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(0, 10, 3), [ +b("File \"jscomp/test/bs_array_test.ml\", line 92, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(0, 10, 3), [ 0, 3, 6, 9 ])); -b("File \"jscomp/test/bs_array_test.ml\", line 92, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(0, 12, 3), [ +b("File \"jscomp/test/bs_array_test.ml\", line 93, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(0, 12, 3), [ 0, 3, 6, @@ -336,28 +336,28 @@ b("File \"jscomp/test/bs_array_test.ml\", line 92, characters 4-11", Caml_obj.ca 12 ])); -b("File \"jscomp/test/bs_array_test.ml\", line 93, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(33, 0, 1), [])); +b("File \"jscomp/test/bs_array_test.ml\", line 94, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(33, 0, 1), [])); -b("File \"jscomp/test/bs_array_test.ml\", line 94, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(33, 0, -1), [])); +b("File \"jscomp/test/bs_array_test.ml\", line 95, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(33, 0, -1), [])); -b("File \"jscomp/test/bs_array_test.ml\", line 95, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 12, -1), [])); +b("File \"jscomp/test/bs_array_test.ml\", line 96, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 12, -1), [])); -b("File \"jscomp/test/bs_array_test.ml\", line 96, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 3, 0), [])); +b("File \"jscomp/test/bs_array_test.ml\", line 97, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 3, 0), [])); -b("File \"jscomp/test/bs_array_test.ml\", line 97, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 3, 1), [3])); +b("File \"jscomp/test/bs_array_test.ml\", line 98, characters 4-11", Caml_obj.caml_equal(Belt__Belt_Array.rangeBy(3, 3, 1), [3])); -eq("File \"jscomp/test/bs_array_test.ml\", line 102, characters 5-12", Belt__Belt_Array.reduceReverse([], 100, (function (prim0, prim1) { +eq("File \"jscomp/test/bs_array_test.ml\", line 103, characters 5-12", Belt__Belt_Array.reduceReverse([], 100, (function (prim0, prim1) { return prim0 - prim1 | 0; })), 100); -eq("File \"jscomp/test/bs_array_test.ml\", line 103, characters 5-12", Belt__Belt_Array.reduceReverse([ +eq("File \"jscomp/test/bs_array_test.ml\", line 104, characters 5-12", Belt__Belt_Array.reduceReverse([ 1, 2 ], 100, (function (prim0, prim1) { return prim0 - prim1 | 0; })), 97); -eq("File \"jscomp/test/bs_array_test.ml\", line 104, characters 5-12", Belt__Belt_Array.reduceReverse([ +eq("File \"jscomp/test/bs_array_test.ml\", line 105, characters 5-12", Belt__Belt_Array.reduceReverse([ 1, 2, 3, @@ -366,7 +366,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 104, characters 5-12", Belt__Bel return prim0 - prim1 | 0; })), 90); -eq("File \"jscomp/test/bs_array_test.ml\", line 105, characters 5-12", Belt__Belt_Array.reduceWithIndex([ +eq("File \"jscomp/test/bs_array_test.ml\", line 106, characters 5-12", Belt__Belt_Array.reduceWithIndex([ 1, 2, 3, @@ -375,7 +375,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 105, characters 5-12", Belt__Bel return (acc + x | 0) + i | 0; })), 16); -b("File \"jscomp/test/bs_array_test.ml\", line 106, characters 4-11", Belt__Belt_Array.reduceReverse2([ +b("File \"jscomp/test/bs_array_test.ml\", line 107, characters 4-11", Belt__Belt_Array.reduceReverse2([ 1, 2, 3 @@ -396,7 +396,7 @@ function makeMatrixExn(sx, sy, init) { RE_EXN_ID: "Assert_failure", _1: [ "jscomp/test/bs_array_test.ml", - 112, + 113, 2 ], Error: new Error() @@ -413,11 +413,11 @@ function makeMatrixExn(sx, sy, init) { return res; } -eq("File \"jscomp/test/bs_array_test.ml\", line 124, characters 5-12", Belt__Belt_Array.makeBy(0, (function (param) { +eq("File \"jscomp/test/bs_array_test.ml\", line 125, characters 5-12", Belt__Belt_Array.makeBy(0, (function (param) { return 1; })), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 125, characters 5-12", Belt__Belt_Array.makeBy(3, (function (i) { +eq("File \"jscomp/test/bs_array_test.ml\", line 126, characters 5-12", Belt__Belt_Array.makeBy(3, (function (i) { return i; })), [ 0, @@ -425,7 +425,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 125, characters 5-12", Belt__Bel 2 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 126, characters 5-12", makeMatrixExn(3, 4, 1), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 127, characters 5-12", makeMatrixExn(3, 4, 1), [ [ 1, 1, @@ -446,25 +446,25 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 126, characters 5-12", makeMatri ] ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 129, characters 5-12", makeMatrixExn(3, 0, 0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 130, characters 5-12", makeMatrixExn(3, 0, 0), [ [], [], [] ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 130, characters 5-12", makeMatrixExn(0, 3, 1), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 131, characters 5-12", makeMatrixExn(0, 3, 1), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 131, characters 5-12", makeMatrixExn(1, 1, 1), [[1]]); +eq("File \"jscomp/test/bs_array_test.ml\", line 132, characters 5-12", makeMatrixExn(1, 1, 1), [[1]]); -eq("File \"jscomp/test/bs_array_test.ml\", line 132, characters 5-12", [].slice(0), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 133, characters 5-12", [].slice(0), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 133, characters 5-12", Belt__Belt_Array.map([], (function (prim) { +eq("File \"jscomp/test/bs_array_test.ml\", line 134, characters 5-12", Belt__Belt_Array.map([], (function (prim) { return prim + 1 | 0; })), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 134, characters 5-12", Belt__Belt_Array.mapWithIndex([], add), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 135, characters 5-12", Belt__Belt_Array.mapWithIndex([], add), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 135, characters 5-12", Belt__Belt_Array.mapWithIndex([ +eq("File \"jscomp/test/bs_array_test.ml\", line 136, characters 5-12", Belt__Belt_Array.mapWithIndex([ 1, 2, 3 @@ -474,14 +474,14 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 135, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 136, characters 5-12", Belt__Belt_List.fromArray([]), /* [] */0); +eq("File \"jscomp/test/bs_array_test.ml\", line 137, characters 5-12", Belt__Belt_List.fromArray([]), /* [] */0); -eq("File \"jscomp/test/bs_array_test.ml\", line 137, characters 5-12", Belt__Belt_List.fromArray([1]), { +eq("File \"jscomp/test/bs_array_test.ml\", line 138, characters 5-12", Belt__Belt_List.fromArray([1]), { hd: 1, tl: /* [] */0 }); -eq("File \"jscomp/test/bs_array_test.ml\", line 138, characters 5-12", Belt__Belt_List.fromArray([ +eq("File \"jscomp/test/bs_array_test.ml\", line 139, characters 5-12", Belt__Belt_List.fromArray([ 1, 2, 3 @@ -496,7 +496,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 138, characters 5-12", Belt__Bel } }); -eq("File \"jscomp/test/bs_array_test.ml\", line 139, characters 5-12", Belt__Belt_Array.map([ +eq("File \"jscomp/test/bs_array_test.ml\", line 140, characters 5-12", Belt__Belt_Array.map([ 1, 2, 3 @@ -508,14 +508,14 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 139, characters 5-12", Belt__Bel 4 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 140, characters 5-12", Belt__Belt_List.toArray(/* [] */0), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 141, characters 5-12", Belt__Belt_List.toArray(/* [] */0), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 141, characters 5-12", Belt__Belt_List.toArray({ +eq("File \"jscomp/test/bs_array_test.ml\", line 142, characters 5-12", Belt__Belt_List.toArray({ hd: 1, tl: /* [] */0 }), [1]); -eq("File \"jscomp/test/bs_array_test.ml\", line 142, characters 5-12", Belt__Belt_List.toArray({ +eq("File \"jscomp/test/bs_array_test.ml\", line 143, characters 5-12", Belt__Belt_List.toArray({ hd: 1, tl: { hd: 2, @@ -526,7 +526,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 142, characters 5-12", Belt__Bel 2 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 143, characters 5-12", Belt__Belt_List.toArray({ +eq("File \"jscomp/test/bs_array_test.ml\", line 144, characters 5-12", Belt__Belt_List.toArray({ hd: 1, tl: { hd: 2, @@ -560,7 +560,7 @@ var v2 = Belt__Belt_Array.keepMap(v$6, (function (x) { })); -eq("File \"jscomp/test/bs_array_test.ml\", line 150, characters 5-12", v0, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 151, characters 5-12", v0, [ 0, 2, 4, @@ -568,14 +568,14 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 150, characters 5-12", v0, [ 8 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 151, characters 5-12", v1, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 152, characters 5-12", v1, [ 0, 3, 6, 9 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 152, characters 5-12", v2, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 153, characters 5-12", v2, [ 1, 3, 5, @@ -595,12 +595,12 @@ var match = Belt__Belt_Array.partition(a$2, (function (x) { return x % 2 === 0; })); -eq("File \"jscomp/test/bs_array_test.ml\", line 157, characters 5-12", match[0], [ +eq("File \"jscomp/test/bs_array_test.ml\", line 158, characters 5-12", match[0], [ 2, 4 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 158, characters 5-12", match[1], [ +eq("File \"jscomp/test/bs_array_test.ml\", line 159, characters 5-12", match[1], [ 1, 3, 5 @@ -610,9 +610,9 @@ var match$1 = Belt__Belt_Array.partition(a$2, (function (x) { return x === 2; })); -eq("File \"jscomp/test/bs_array_test.ml\", line 160, characters 5-12", match$1[0], [2]); +eq("File \"jscomp/test/bs_array_test.ml\", line 161, characters 5-12", match$1[0], [2]); -eq("File \"jscomp/test/bs_array_test.ml\", line 161, characters 5-12", match$1[1], [ +eq("File \"jscomp/test/bs_array_test.ml\", line 162, characters 5-12", match$1[1], [ 1, 3, 4, @@ -623,9 +623,9 @@ var match$2 = Belt__Belt_Array.partition([], (function (x) { return false; })); -eq("File \"jscomp/test/bs_array_test.ml\", line 163, characters 5-12", match$2[0], []); +eq("File \"jscomp/test/bs_array_test.ml\", line 164, characters 5-12", match$2[0], []); -eq("File \"jscomp/test/bs_array_test.ml\", line 164, characters 5-12", match$2[1], []); +eq("File \"jscomp/test/bs_array_test.ml\", line 165, characters 5-12", match$2[1], []); var a$3 = [ 1, @@ -635,12 +635,12 @@ var a$3 = [ 5 ]; -eq("File \"jscomp/test/bs_array_test.ml\", line 168, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 2), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 169, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 2), [ 1, 2 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 169, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 5), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 170, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 5), [ 1, 2, 3, @@ -648,7 +648,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 169, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 170, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 15), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 171, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 15), [ 1, 2, 3, @@ -656,40 +656,40 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 170, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 171, characters 5-12", Belt__Belt_Array.slice(a$3, 5, 1), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 172, characters 5-12", Belt__Belt_Array.slice(a$3, 5, 1), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 172, characters 5-12", Belt__Belt_Array.slice(a$3, 4, 1), [5]); +eq("File \"jscomp/test/bs_array_test.ml\", line 173, characters 5-12", Belt__Belt_Array.slice(a$3, 4, 1), [5]); -eq("File \"jscomp/test/bs_array_test.ml\", line 173, characters 5-12", Belt__Belt_Array.slice(a$3, -1, 1), [5]); +eq("File \"jscomp/test/bs_array_test.ml\", line 174, characters 5-12", Belt__Belt_Array.slice(a$3, -1, 1), [5]); -eq("File \"jscomp/test/bs_array_test.ml\", line 174, characters 5-12", Belt__Belt_Array.slice(a$3, -1, 2), [5]); +eq("File \"jscomp/test/bs_array_test.ml\", line 175, characters 5-12", Belt__Belt_Array.slice(a$3, -1, 2), [5]); -eq("File \"jscomp/test/bs_array_test.ml\", line 175, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 1), [4]); +eq("File \"jscomp/test/bs_array_test.ml\", line 176, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 1), [4]); -eq("File \"jscomp/test/bs_array_test.ml\", line 176, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 2), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 177, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 2), [ 4, 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 177, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 3), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 178, characters 5-12", Belt__Belt_Array.slice(a$3, -2, 3), [ 4, 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 178, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 3), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 179, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 3), [ 1, 2, 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 179, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 4), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 180, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 4), [ 1, 2, 3, 4 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 180, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 5), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 181, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 5), [ 1, 2, 3, @@ -697,7 +697,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 180, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 181, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 6), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 182, characters 5-12", Belt__Belt_Array.slice(a$3, -10, 6), [ 1, 2, 3, @@ -705,9 +705,9 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 181, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 182, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 0), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 183, characters 5-12", Belt__Belt_Array.slice(a$3, 0, 0), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 183, characters 5-12", Belt__Belt_Array.slice(a$3, 0, -1), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 184, characters 5-12", Belt__Belt_Array.slice(a$3, 0, -1), []); var a$4 = [ 1, @@ -717,7 +717,7 @@ var a$4 = [ 5 ]; -eq("File \"jscomp/test/bs_array_test.ml\", line 187, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 188, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 0), [ 1, 2, 3, @@ -725,18 +725,18 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 187, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 188, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 5), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 189, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 5), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 189, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 4), [5]); +eq("File \"jscomp/test/bs_array_test.ml\", line 190, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 4), [5]); -eq("File \"jscomp/test/bs_array_test.ml\", line 190, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -1), [5]); +eq("File \"jscomp/test/bs_array_test.ml\", line 191, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -1), [5]); -eq("File \"jscomp/test/bs_array_test.ml\", line 191, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -2), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 192, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -2), [ 4, 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 192, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -10), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 193, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, -10), [ 1, 2, 3, @@ -744,7 +744,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 192, characters 5-12", Belt__Bel 5 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 193, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 6), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 194, characters 5-12", Belt__Belt_Array.sliceToEnd(a$4, 6), []); var a$5 = Belt__Belt_Array.makeBy(10, (function (x) { return x; @@ -752,7 +752,7 @@ var a$5 = Belt__Belt_Array.makeBy(10, (function (x) { Belt__Belt_Array.fill(a$5, 0, 3, 0); -eq("File \"jscomp/test/bs_array_test.ml\", line 197, characters 6-13", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 198, characters 6-13", a$5.slice(0), [ 0, 0, 0, @@ -767,7 +767,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 197, characters 6-13", a$5.slice Belt__Belt_Array.fill(a$5, 2, 8, 1); -eq("File \"jscomp/test/bs_array_test.ml\", line 199, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 200, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -782,7 +782,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 199, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, 8, 1, 9); -eq("File \"jscomp/test/bs_array_test.ml\", line 201, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 202, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -797,7 +797,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 201, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, 8, 2, 9); -eq("File \"jscomp/test/bs_array_test.ml\", line 203, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 204, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -812,7 +812,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 203, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, 8, 3, 12); -eq("File \"jscomp/test/bs_array_test.ml\", line 205, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 206, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -827,7 +827,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 205, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, -2, 3, 11); -eq("File \"jscomp/test/bs_array_test.ml\", line 207, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 208, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -842,7 +842,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 207, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, -3, 3, 10); -eq("File \"jscomp/test/bs_array_test.ml\", line 209, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 210, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -857,7 +857,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 209, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, -3, 1, 7); -eq("File \"jscomp/test/bs_array_test.ml\", line 211, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 212, characters 5-12", a$5.slice(0), [ 0, 0, 1, @@ -872,7 +872,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 211, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, -13, 1, 7); -eq("File \"jscomp/test/bs_array_test.ml\", line 213, characters 5-12", a$5.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 214, characters 5-12", a$5.slice(0), [ 7, 0, 1, @@ -887,11 +887,11 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 213, characters 5-12", a$5.slice Belt__Belt_Array.fill(a$5, -13, 12, 7); -eq("File \"jscomp/test/bs_array_test.ml\", line 215, characters 5-12", a$5.slice(0), Belt__Belt_Array.make(10, 7)); +eq("File \"jscomp/test/bs_array_test.ml\", line 216, characters 5-12", a$5.slice(0), Belt__Belt_Array.make(10, 7)); Belt__Belt_Array.fill(a$5, 0, -1, 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 217, characters 5-12", a$5.slice(0), Belt__Belt_Array.make(10, 7)); +eq("File \"jscomp/test/bs_array_test.ml\", line 218, characters 5-12", a$5.slice(0), Belt__Belt_Array.make(10, 7)); var b$1 = [ 1, @@ -901,7 +901,7 @@ var b$1 = [ Belt__Belt_Array.fill(b$1, 0, 0, 0); -eq("File \"jscomp/test/bs_array_test.ml\", line 220, characters 5-12", b$1, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 221, characters 5-12", b$1, [ 1, 2, 3 @@ -909,7 +909,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 220, characters 5-12", b$1, [ Belt__Belt_Array.fill(b$1, 4, 1, 0); -eq("File \"jscomp/test/bs_array_test.ml\", line 222, characters 5-12", b$1, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 223, characters 5-12", b$1, [ 1, 2, 3 @@ -923,7 +923,7 @@ var b0 = Belt__Belt_Array.make(10, 3); Belt__Belt_Array.blit(a0, 1, b0, 2, 5); -eq("File \"jscomp/test/bs_array_test.ml\", line 228, characters 5-12", b0.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 229, characters 5-12", b0.slice(0), [ 3, 3, 1, @@ -938,7 +938,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 228, characters 5-12", b0.slice( Belt__Belt_Array.blit(a0, -1, b0, 2, 5); -eq("File \"jscomp/test/bs_array_test.ml\", line 231, characters 5-12", b0.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 232, characters 5-12", b0.slice(0), [ 3, 3, 9, @@ -953,7 +953,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 231, characters 5-12", b0.slice( Belt__Belt_Array.blit(a0, -1, b0, -2, 5); -eq("File \"jscomp/test/bs_array_test.ml\", line 234, characters 5-12", b0.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 235, characters 5-12", b0.slice(0), [ 3, 3, 9, @@ -968,7 +968,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 234, characters 5-12", b0.slice( Belt__Belt_Array.blit(a0, -2, b0, -2, 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 237, characters 5-12", b0.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 238, characters 5-12", b0.slice(0), [ 3, 3, 9, @@ -983,11 +983,11 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 237, characters 5-12", b0.slice( Belt__Belt_Array.blit(a0, -11, b0, -11, 100); -eq("File \"jscomp/test/bs_array_test.ml\", line 240, characters 5-12", b0.slice(0), a0); +eq("File \"jscomp/test/bs_array_test.ml\", line 241, characters 5-12", b0.slice(0), a0); Belt__Belt_Array.blit(a0, -11, b0, -11, 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 242, characters 5-12", b0.slice(0), a0); +eq("File \"jscomp/test/bs_array_test.ml\", line 243, characters 5-12", b0.slice(0), a0); var aa = Belt__Belt_Array.makeBy(10, (function (x) { return x; @@ -995,7 +995,7 @@ var aa = Belt__Belt_Array.makeBy(10, (function (x) { Belt__Belt_Array.blit(aa, -1, aa, 1, 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 245, characters 5-12", aa.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 246, characters 5-12", aa.slice(0), [ 0, 9, 2, @@ -1010,7 +1010,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 245, characters 5-12", aa.slice( Belt__Belt_Array.blit(aa, -2, aa, 1, 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 247, characters 5-12", aa.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 248, characters 5-12", aa.slice(0), [ 0, 8, 9, @@ -1025,7 +1025,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 247, characters 5-12", aa.slice( Belt__Belt_Array.blit(aa, -5, aa, 4, 3); -eq("File \"jscomp/test/bs_array_test.ml\", line 249, characters 5-12", aa.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 250, characters 5-12", aa.slice(0), [ 0, 8, 9, @@ -1040,7 +1040,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 249, characters 5-12", aa.slice( Belt__Belt_Array.blit(aa, 4, aa, 5, 3); -eq("File \"jscomp/test/bs_array_test.ml\", line 251, characters 5-12", aa.slice(0), [ +eq("File \"jscomp/test/bs_array_test.ml\", line 252, characters 5-12", aa.slice(0), [ 0, 8, 9, @@ -1053,9 +1053,9 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 251, characters 5-12", aa.slice( 9 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 252, characters 5-12", Belt__Belt_Array.make(0, 3), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 253, characters 5-12", Belt__Belt_Array.make(0, 3), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 253, characters 5-12", Belt__Belt_Array.make(-1, 3), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 254, characters 5-12", Belt__Belt_Array.make(-1, 3), []); var c = [ 0, @@ -1065,13 +1065,13 @@ var c = [ Belt__Belt_Array.blit(c, 4, c, 1, 1); -eq("File \"jscomp/test/bs_array_test.ml\", line 256, characters 5-12", c, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 257, characters 5-12", c, [ 0, 1, 2 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 259, characters 5-12", Belt__Belt_Array.zip([ +eq("File \"jscomp/test/bs_array_test.ml\", line 260, characters 5-12", Belt__Belt_Array.zip([ 1, 2, 3 @@ -1095,7 +1095,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 259, characters 5-12", Belt__Bel ] ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 260, characters 5-12", Belt__Belt_Array.zip([ +eq("File \"jscomp/test/bs_array_test.ml\", line 261, characters 5-12", Belt__Belt_Array.zip([ 2, 3, 4, @@ -1119,7 +1119,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 260, characters 5-12", Belt__Bel ] ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 261, characters 5-12", Belt__Belt_Array.zipBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 262, characters 5-12", Belt__Belt_Array.zipBy([ 2, 3, 4, @@ -1136,7 +1136,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 261, characters 5-12", Belt__Bel 1 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 262, characters 5-12", Belt__Belt_Array.zipBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 263, characters 5-12", Belt__Belt_Array.zipBy([ 1, 2, 3 @@ -1155,7 +1155,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 262, characters 5-12", Belt__Bel return -x | 0; }))); -eq("File \"jscomp/test/bs_array_test.ml\", line 263, characters 5-12", Belt__Belt_Array.unzip([ +eq("File \"jscomp/test/bs_array_test.ml\", line 264, characters 5-12", Belt__Belt_Array.unzip([ [ 1, 2 @@ -1191,7 +1191,7 @@ function sumUsingForEach(xs) { return v.contents; } -eq("File \"jscomp/test/bs_array_test.ml\", line 273, characters 5-12", sumUsingForEach([ +eq("File \"jscomp/test/bs_array_test.ml\", line 274, characters 5-12", sumUsingForEach([ 0, 1, 2, @@ -1199,7 +1199,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 273, characters 5-12", sumUsingF 4 ]), 10); -b("File \"jscomp/test/bs_array_test.ml\", line 274, characters 4-11", !Belt__Belt_Array.every([ +b("File \"jscomp/test/bs_array_test.ml\", line 275, characters 4-11", !Belt__Belt_Array.every([ 0, 1, 2, @@ -1209,7 +1209,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 274, characters 4-11", !Belt__Bel return x > 2; }))); -b("File \"jscomp/test/bs_array_test.ml\", line 275, characters 4-11", Belt__Belt_Array.some([ +b("File \"jscomp/test/bs_array_test.ml\", line 276, characters 4-11", Belt__Belt_Array.some([ 1, 3, 7, @@ -1218,7 +1218,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 275, characters 4-11", Belt__Belt return x % 2 === 0; }))); -b("File \"jscomp/test/bs_array_test.ml\", line 276, characters 4-11", !Belt__Belt_Array.some([ +b("File \"jscomp/test/bs_array_test.ml\", line 277, characters 4-11", !Belt__Belt_Array.some([ 1, 3, 7 @@ -1226,7 +1226,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 276, characters 4-11", !Belt__Bel return x % 2 === 0; }))); -b("File \"jscomp/test/bs_array_test.ml\", line 277, characters 4-11", !Belt__Belt_Array.eq([ +b("File \"jscomp/test/bs_array_test.ml\", line 278, characters 4-11", !Belt__Belt_Array.eq([ 0, 1 ], [1], (function (prim0, prim1) { @@ -1237,7 +1237,7 @@ var c$1 = { contents: 0 }; -b("File \"jscomp/test/bs_array_test.ml\", line 278, characters 4-11", (Belt__Belt_Array.forEachWithIndex([ +b("File \"jscomp/test/bs_array_test.ml\", line 279, characters 4-11", (Belt__Belt_Array.forEachWithIndex([ 1, 1, 1 @@ -1247,25 +1247,25 @@ b("File \"jscomp/test/bs_array_test.ml\", line 278, characters 4-11", (Belt__Bel function id$1(loc, x) { var u = x.slice(0); - eq("File \"jscomp/test/bs_array_test.ml\", line 288, characters 5-12", Belt__Belt_Array.reverse(x), (Belt__Belt_Array.reverseInPlace(u), u)); + eq("File \"jscomp/test/bs_array_test.ml\", line 289, characters 5-12", Belt__Belt_Array.reverse(x), (Belt__Belt_Array.reverseInPlace(u), u)); } -id$1("File \"jscomp/test/bs_array_test.ml\", line 293, characters 5-12", []); +id$1("File \"jscomp/test/bs_array_test.ml\", line 294, characters 5-12", []); -id$1("File \"jscomp/test/bs_array_test.ml\", line 294, characters 5-12", [1]); +id$1("File \"jscomp/test/bs_array_test.ml\", line 295, characters 5-12", [1]); -id$1("File \"jscomp/test/bs_array_test.ml\", line 295, characters 5-12", [ +id$1("File \"jscomp/test/bs_array_test.ml\", line 296, characters 5-12", [ 1, 2 ]); -id$1("File \"jscomp/test/bs_array_test.ml\", line 296, characters 5-12", [ +id$1("File \"jscomp/test/bs_array_test.ml\", line 297, characters 5-12", [ 1, 2, 3 ]); -id$1("File \"jscomp/test/bs_array_test.ml\", line 297, characters 5-12", [ +id$1("File \"jscomp/test/bs_array_test.ml\", line 298, characters 5-12", [ 1, 2, 3, @@ -1288,14 +1288,14 @@ function some2(xs, ys) { }; } -eq("File \"jscomp/test/bs_array_test.ml\", line 307, characters 5-12", every2(/* [] */0, { +eq("File \"jscomp/test/bs_array_test.ml\", line 308, characters 5-12", every2(/* [] */0, { hd: 1, tl: /* [] */0 })(function (x, y) { return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 308, characters 5-12", every2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 309, characters 5-12", every2({ hd: 2, tl: { hd: 3, @@ -1308,7 +1308,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 308, characters 5-12", every2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 309, characters 5-12", every2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 310, characters 5-12", every2({ hd: 2, tl: /* [] */0 }, { @@ -1318,7 +1318,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 309, characters 5-12", every2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 310, characters 5-12", every2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 311, characters 5-12", every2({ hd: 2, tl: { hd: 3, @@ -1334,7 +1334,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 310, characters 5-12", every2({ return x > y; }), false); -eq("File \"jscomp/test/bs_array_test.ml\", line 311, characters 5-12", every2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 312, characters 5-12", every2({ hd: 2, tl: { hd: 3, @@ -1350,14 +1350,14 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 311, characters 5-12", every2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 312, characters 5-12", some2(/* [] */0, { +eq("File \"jscomp/test/bs_array_test.ml\", line 313, characters 5-12", some2(/* [] */0, { hd: 1, tl: /* [] */0 })(function (x, y) { return x > y; }), false); -eq("File \"jscomp/test/bs_array_test.ml\", line 313, characters 5-12", some2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 314, characters 5-12", some2({ hd: 2, tl: { hd: 3, @@ -1370,7 +1370,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 313, characters 5-12", some2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 314, characters 5-12", some2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 315, characters 5-12", some2({ hd: 2, tl: { hd: 3, @@ -1386,7 +1386,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 314, characters 5-12", some2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 315, characters 5-12", some2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 316, characters 5-12", some2({ hd: 0, tl: { hd: 3, @@ -1402,7 +1402,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 315, characters 5-12", some2({ return x > y; }), false); -eq("File \"jscomp/test/bs_array_test.ml\", line 316, characters 5-12", some2({ +eq("File \"jscomp/test/bs_array_test.ml\", line 317, characters 5-12", some2({ hd: 0, tl: { hd: 3, @@ -1418,7 +1418,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 316, characters 5-12", some2({ return x > y; }), true); -eq("File \"jscomp/test/bs_array_test.ml\", line 321, characters 5-12", Belt__Belt_Array.concat([], [ +eq("File \"jscomp/test/bs_array_test.ml\", line 322, characters 5-12", Belt__Belt_Array.concat([], [ 1, 2, 3 @@ -1428,9 +1428,9 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 321, characters 5-12", Belt__Bel 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 322, characters 5-12", Belt__Belt_Array.concat([], []), []); +eq("File \"jscomp/test/bs_array_test.ml\", line 323, characters 5-12", Belt__Belt_Array.concat([], []), []); -eq("File \"jscomp/test/bs_array_test.ml\", line 323, characters 5-12", Belt__Belt_Array.concat([ +eq("File \"jscomp/test/bs_array_test.ml\", line 324, characters 5-12", Belt__Belt_Array.concat([ 3, 2 ], [ @@ -1445,7 +1445,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 323, characters 5-12", Belt__Bel 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 324, characters 5-12", Belt__Belt_Array.concatMany([ +eq("File \"jscomp/test/bs_array_test.ml\", line 325, characters 5-12", Belt__Belt_Array.concatMany([ [ 3, 2 @@ -1463,7 +1463,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 324, characters 5-12", Belt__Bel 3 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 325, characters 5-12", Belt__Belt_Array.concatMany([ +eq("File \"jscomp/test/bs_array_test.ml\", line 326, characters 5-12", Belt__Belt_Array.concatMany([ [ 3, 2 @@ -1484,7 +1484,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 325, characters 5-12", Belt__Bel 0 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 326, characters 5-12", Belt__Belt_Array.concatMany([ +eq("File \"jscomp/test/bs_array_test.ml\", line 327, characters 5-12", Belt__Belt_Array.concatMany([ [], [ 3, @@ -1506,12 +1506,12 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 326, characters 5-12", Belt__Bel 0 ]); -eq("File \"jscomp/test/bs_array_test.ml\", line 327, characters 5-12", Belt__Belt_Array.concatMany([ +eq("File \"jscomp/test/bs_array_test.ml\", line 328, characters 5-12", Belt__Belt_Array.concatMany([ [], [] ]), []); -b("File \"jscomp/test/bs_array_test.ml\", line 330, characters 4-11", Belt__Belt_Array.cmp([ +b("File \"jscomp/test/bs_array_test.ml\", line 331, characters 4-11", Belt__Belt_Array.cmp([ 1, 2, 3 @@ -1522,7 +1522,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 330, characters 4-11", Belt__Belt 3 ], Caml.caml_int_compare) < 0); -b("File \"jscomp/test/bs_array_test.ml\", line 331, characters 4-11", Belt__Belt_Array.cmp([ +b("File \"jscomp/test/bs_array_test.ml\", line 332, characters 4-11", Belt__Belt_Array.cmp([ 0, 1, 2, @@ -1533,7 +1533,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 331, characters 4-11", Belt__Belt 3 ], Caml.caml_int_compare) > 0); -b("File \"jscomp/test/bs_array_test.ml\", line 332, characters 4-11", Belt__Belt_Array.cmp([ +b("File \"jscomp/test/bs_array_test.ml\", line 333, characters 4-11", Belt__Belt_Array.cmp([ 1, 2, 3 @@ -1543,7 +1543,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 332, characters 4-11", Belt__Belt 2 ], Caml.caml_int_compare) > 0); -b("File \"jscomp/test/bs_array_test.ml\", line 333, characters 4-11", Belt__Belt_Array.cmp([ +b("File \"jscomp/test/bs_array_test.ml\", line 334, characters 4-11", Belt__Belt_Array.cmp([ 1, 2, 3 @@ -1553,7 +1553,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 333, characters 4-11", Belt__Belt 3 ], Caml.caml_int_compare) === 0); -b("File \"jscomp/test/bs_array_test.ml\", line 334, characters 4-11", Belt__Belt_Array.cmp([ +b("File \"jscomp/test/bs_array_test.ml\", line 335, characters 4-11", Belt__Belt_Array.cmp([ 1, 2, 4 @@ -1563,7 +1563,7 @@ b("File \"jscomp/test/bs_array_test.ml\", line 334, characters 4-11", Belt__Belt 3 ], Caml.caml_int_compare) > 0); -eq("File \"jscomp/test/bs_array_test.ml\", line 337, characters 5-12", Belt__Belt_Array.getBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 338, characters 5-12", Belt__Belt_Array.getBy([ 1, 2, 3 @@ -1571,7 +1571,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 337, characters 5-12", Belt__Bel return x > 1; })), 2); -eq("File \"jscomp/test/bs_array_test.ml\", line 338, characters 5-12", Belt__Belt_Array.getBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 339, characters 5-12", Belt__Belt_Array.getBy([ 1, 2, 3 @@ -1579,7 +1579,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 338, characters 5-12", Belt__Bel return x > 3; })), undefined); -eq("File \"jscomp/test/bs_array_test.ml\", line 341, characters 5-12", Belt__Belt_Array.getIndexBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 342, characters 5-12", Belt__Belt_Array.getIndexBy([ 1, 2, 3 @@ -1587,7 +1587,7 @@ eq("File \"jscomp/test/bs_array_test.ml\", line 341, characters 5-12", Belt__Bel return x > 1; })), 1); -eq("File \"jscomp/test/bs_array_test.ml\", line 342, characters 5-12", Belt__Belt_Array.getIndexBy([ +eq("File \"jscomp/test/bs_array_test.ml\", line 343, characters 5-12", Belt__Belt_Array.getIndexBy([ 1, 2, 3 @@ -1603,13 +1603,13 @@ arr.push(2); arr.push(1); -eq("File \"jscomp/test/bs_array_test.ml\", line 351, characters 5-12", arr, [ +eq("File \"jscomp/test/bs_array_test.ml\", line 352, characters 5-12", arr, [ 3, 2, 1 ]); -Mt.from_pair_suites("File \"jscomp/test/bs_array_test.ml\", line 353, characters 23-30", suites.contents); +Mt.from_pair_suites("File \"jscomp/test/bs_array_test.ml\", line 354, characters 23-30", suites.contents); exports.suites = suites; exports.test_id = test_id; diff --git a/jscomp/test/dist/jscomp/test/equal_box_test.js b/jscomp/test/dist/jscomp/test/equal_box_test.js index fe10a4c97f..2082340cc9 100644 --- a/jscomp/test/dist/jscomp/test/equal_box_test.js +++ b/jscomp/test/dist/jscomp/test/equal_box_test.js @@ -35,81 +35,81 @@ function shouldBeNull(param) { return null; } -b("File \"jscomp/test/equal_box_test.ml\", line 24, characters 4-11", 3 !== null); +b("File \"jscomp/test/equal_box_test.ml\", line 21, characters 4-11", 3 !== null); -b("File \"jscomp/test/equal_box_test.ml\", line 25, characters 4-11", !Caml_obj.caml_equal_null(undefined, null)); +b("File \"jscomp/test/equal_box_test.ml\", line 22, characters 4-11", !Caml_obj.caml_equal_null(undefined, null)); -b("File \"jscomp/test/equal_box_test.ml\", line 26, characters 4-11", "3" !== null); +b("File \"jscomp/test/equal_box_test.ml\", line 23, characters 4-11", "3" !== null); -b("File \"jscomp/test/equal_box_test.ml\", line 27, characters 4-11", /* '3' */51 !== null); +b("File \"jscomp/test/equal_box_test.ml\", line 24, characters 4-11", /* '3' */51 !== null); -b("File \"jscomp/test/equal_box_test.ml\", line 28, characters 4-11", !Caml_int64.equal_null(Caml_int64.zero, null)); +b("File \"jscomp/test/equal_box_test.ml\", line 25, characters 4-11", !Caml_int64.equal_null(Caml_int64.zero, null)); -b("File \"jscomp/test/equal_box_test.ml\", line 29, characters 4-11", 0 !== null); +b("File \"jscomp/test/equal_box_test.ml\", line 26, characters 4-11", 0 !== null); -b("File \"jscomp/test/equal_box_test.ml\", line 30, characters 4-11", true); +b("File \"jscomp/test/equal_box_test.ml\", line 27, characters 4-11", true); -b("File \"jscomp/test/equal_box_test.ml\", line 31, characters 4-11", !Caml_obj.caml_equal_null(undefined, null)); +b("File \"jscomp/test/equal_box_test.ml\", line 28, characters 4-11", !Caml_obj.caml_equal_null(undefined, null)); -b("File \"jscomp/test/equal_box_test.ml\", line 32, characters 4-11", Caml_obj.caml_equal_null(null, null)); +b("File \"jscomp/test/equal_box_test.ml\", line 29, characters 4-11", Caml_obj.caml_equal_null(null, null)); -b("File \"jscomp/test/equal_box_test.ml\", line 33, characters 4-11", true); +b("File \"jscomp/test/equal_box_test.ml\", line 30, characters 4-11", true); -b("File \"jscomp/test/equal_box_test.ml\", line 34, characters 4-11", Caml_obj.caml_equal_null(undefined, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 31, characters 4-11", Caml_obj.caml_equal_null(undefined, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 35, characters 4-11", !Caml_obj.caml_equal_null(3, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 32, characters 4-11", !Caml_obj.caml_equal_null(3, undefined)); var v = null; -b("File \"jscomp/test/equal_box_test.ml\", line 39, characters 4-11", 3 !== v); +b("File \"jscomp/test/equal_box_test.ml\", line 36, characters 4-11", 3 !== v); -b("File \"jscomp/test/equal_box_test.ml\", line 40, characters 4-11", !Caml_obj.caml_equal_nullable(undefined, v)); +b("File \"jscomp/test/equal_box_test.ml\", line 37, characters 4-11", !Caml_obj.caml_equal_nullable(undefined, v)); -b("File \"jscomp/test/equal_box_test.ml\", line 41, characters 4-11", "3" !== v); +b("File \"jscomp/test/equal_box_test.ml\", line 38, characters 4-11", "3" !== v); -b("File \"jscomp/test/equal_box_test.ml\", line 42, characters 4-11", /* '3' */51 !== v); +b("File \"jscomp/test/equal_box_test.ml\", line 39, characters 4-11", /* '3' */51 !== v); -b("File \"jscomp/test/equal_box_test.ml\", line 43, characters 4-11", !Caml_int64.equal_nullable(Caml_int64.zero, v)); +b("File \"jscomp/test/equal_box_test.ml\", line 40, characters 4-11", !Caml_int64.equal_nullable(Caml_int64.zero, v)); -b("File \"jscomp/test/equal_box_test.ml\", line 44, characters 4-11", 0 !== v); +b("File \"jscomp/test/equal_box_test.ml\", line 41, characters 4-11", 0 !== v); -b("File \"jscomp/test/equal_box_test.ml\", line 45, characters 4-11", 0 !== v); +b("File \"jscomp/test/equal_box_test.ml\", line 42, characters 4-11", 0 !== v); -b("File \"jscomp/test/equal_box_test.ml\", line 46, characters 4-11", !Caml_obj.caml_equal_nullable(undefined, v)); +b("File \"jscomp/test/equal_box_test.ml\", line 43, characters 4-11", !Caml_obj.caml_equal_nullable(undefined, v)); -b("File \"jscomp/test/equal_box_test.ml\", line 47, characters 4-11", Caml_obj.caml_equal_nullable(null, v)); +b("File \"jscomp/test/equal_box_test.ml\", line 44, characters 4-11", Caml_obj.caml_equal_nullable(null, v)); -b("File \"jscomp/test/equal_box_test.ml\", line 48, characters 4-11", true); +b("File \"jscomp/test/equal_box_test.ml\", line 45, characters 4-11", true); -b("File \"jscomp/test/equal_box_test.ml\", line 49, characters 4-11", Caml_obj.caml_equal_nullable(undefined, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 46, characters 4-11", Caml_obj.caml_equal_nullable(undefined, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 50, characters 4-11", !Caml_obj.caml_equal_nullable(3, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 47, characters 4-11", !Caml_obj.caml_equal_nullable(3, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 55, characters 4-11", 3 !== undefined); +b("File \"jscomp/test/equal_box_test.ml\", line 52, characters 4-11", 3 !== undefined); -b("File \"jscomp/test/equal_box_test.ml\", line 56, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 53, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 57, characters 4-11", "3" !== undefined); +b("File \"jscomp/test/equal_box_test.ml\", line 54, characters 4-11", "3" !== undefined); -b("File \"jscomp/test/equal_box_test.ml\", line 58, characters 4-11", /* '3' */51 !== undefined); +b("File \"jscomp/test/equal_box_test.ml\", line 55, characters 4-11", /* '3' */51 !== undefined); -b("File \"jscomp/test/equal_box_test.ml\", line 59, characters 4-11", !Caml_int64.equal_undefined(Caml_int64.zero, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 56, characters 4-11", !Caml_int64.equal_undefined(Caml_int64.zero, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 60, characters 4-11", 0 !== undefined); +b("File \"jscomp/test/equal_box_test.ml\", line 57, characters 4-11", 0 !== undefined); -b("File \"jscomp/test/equal_box_test.ml\", line 61, characters 4-11", true); +b("File \"jscomp/test/equal_box_test.ml\", line 58, characters 4-11", true); -b("File \"jscomp/test/equal_box_test.ml\", line 62, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 59, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 66, characters 4-11", !Caml_obj.caml_equal_undefined(null, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 63, characters 4-11", !Caml_obj.caml_equal_undefined(null, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 67, characters 4-11", true); +b("File \"jscomp/test/equal_box_test.ml\", line 64, characters 4-11", true); -b("File \"jscomp/test/equal_box_test.ml\", line 68, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 65, characters 4-11", Caml_obj.caml_equal_undefined(undefined, undefined)); -b("File \"jscomp/test/equal_box_test.ml\", line 69, characters 4-11", !Caml_obj.caml_equal_undefined(3, undefined)); +b("File \"jscomp/test/equal_box_test.ml\", line 66, characters 4-11", !Caml_obj.caml_equal_undefined(3, undefined)); -Mt.from_pair_suites("File \"jscomp/test/equal_box_test.ml\", line 74, characters 23-30", suites.contents); +Mt.from_pair_suites("File \"jscomp/test/equal_box_test.ml\", line 71, characters 23-30", suites.contents); exports.aa = aa; exports.bb = bb; diff --git a/jscomp/test/dist/jscomp/test/fib.js b/jscomp/test/dist/jscomp/test/fib.js index a22359ef3e..43a24e55f1 100644 --- a/jscomp/test/dist/jscomp/test/fib.js +++ b/jscomp/test/dist/jscomp/test/fib.js @@ -31,7 +31,7 @@ function fib2(n) { function fib3(n) { var a = 1; var b = 1; - for(var i = 1; i <= n; ++i){ + for(var _i = 1; _i <= n; ++_i){ var tmp = a; a = b; b = b + tmp | 0; diff --git a/jscomp/test/dist/jscomp/test/for_loop_test.js b/jscomp/test/dist/jscomp/test/for_loop_test.js index baf6667e03..6c1905ec23 100644 --- a/jscomp/test/dist/jscomp/test/for_loop_test.js +++ b/jscomp/test/dist/jscomp/test/for_loop_test.js @@ -85,7 +85,7 @@ function for_6(x, u) { }; var inspect_3 = -1; v4.contents = v4.contents + 1 | 0; - for(var j = 0; j <= 1; ++j){ + for(var _j = 0; _j <= 1; ++_j){ v5.contents = v5.contents + 1 | 0; var v2 = { contents: 0 diff --git a/jscomp/test/dist/jscomp/test/for_side_effect_test.js b/jscomp/test/dist/jscomp/test/for_side_effect_test.js index 17fc95a4f0..38575a0b99 100644 --- a/jscomp/test/dist/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/dist/jscomp/test/for_side_effect_test.js @@ -4,7 +4,7 @@ var Mt = require("./mt.js"); function tst(param) { - for(var i = (console.log("hi"), 0) ,i_finish = (console.log("hello"), 3); i <= i_finish; ++i){ + for(var _i = (console.log("hi"), 0) ,_i_finish = (console.log("hello"), 3); _i <= _i_finish; ++_i){ } } @@ -13,7 +13,7 @@ function test2(param) { var v = 0; v = 3; v = 10; - for(var i = 0; i <= 1; ++i){ + for(var _i = 0; _i <= 1; ++_i){ } return v; diff --git a/jscomp/test/dist/jscomp/test/gpr_4280_test.js b/jscomp/test/dist/jscomp/test/gpr_4280_test.js index 9938cc35a4..eea2ca1afc 100644 --- a/jscomp/test/dist/jscomp/test/gpr_4280_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_4280_test.js @@ -20,14 +20,14 @@ var u = { }; function div(children, param) { - for(var i = 0; i <= 1; ++i){ + for(var _i = 0; _i <= 1; ++_i){ u.contents = 300; console.log("nonline"); } } function string(s) { - for(var i = 0; i <= 1; ++i){ + for(var _i = 0; _i <= 1; ++_i){ u.contents = 200; console.log("no"); } diff --git a/jscomp/test/dist/jscomp/test/gpr_4900_test.js b/jscomp/test/dist/jscomp/test/gpr_4900_test.js index bfb96db541..132252e58d 100644 --- a/jscomp/test/dist/jscomp/test/gpr_4900_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_4900_test.js @@ -19,15 +19,15 @@ function showToJs(x) { } } -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 15, characters 23-30", showToJs(/* Yes */1), true); +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 13, characters 33-40", showToJs(/* Yes */1), true); -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 16, characters 23-30", showToJs(/* No */0), false); +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 14, characters 33-40", showToJs(/* No */0), false); -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 17, characters 23-30", showToJs(/* After */{ +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4900_test.ml\", line 15, characters 33-40", showToJs(/* After */{ _0: 3 }), true); -Mt.from_pair_suites("File \"jscomp/test/gpr_4900_test.ml\", line 19, characters 20-27", suites.contents); +Mt.from_pair_suites("File \"jscomp/test/gpr_4900_test.ml\", line 17, characters 20-27", suites.contents); var from_pair_suites = Mt.from_pair_suites; diff --git a/jscomp/test/dist/jscomp/test/gpr_4924_test.js b/jscomp/test/dist/jscomp/test/gpr_4924_test.js index a23e3d9cc5..3676cad185 100644 --- a/jscomp/test/dist/jscomp/test/gpr_4924_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_4924_test.js @@ -35,11 +35,11 @@ function u2(b) { } } -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 25, characters 23-30", u2(/* A */0), false); +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 25, characters 33-40", u2(/* A */0), false); -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 26, characters 23-30", u2(/* B */1), true); +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 26, characters 33-40", u2(/* B */1), true); -Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 27, characters 23-30", u2(/* C */{ +Mt.eq_suites(id, suites, "File \"jscomp/test/gpr_4924_test.ml\", line 27, characters 33-40", u2(/* C */{ _0: 2 }), true); diff --git a/jscomp/test/dist/jscomp/test/gpr_977_test.js b/jscomp/test/dist/jscomp/test/gpr_977_test.js index c1a5dd5715..fcc5101fe1 100644 --- a/jscomp/test/dist/jscomp/test/gpr_977_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_977_test.js @@ -30,14 +30,14 @@ function eq(loc, x, y) { } function f(x) { - for(var i = 0; i <= 100; ++i){ + for(var _i = 0; _i <= 100; ++_i){ console.log("."); } return -x | 0; } function int32_f(x) { - for(var i = 0; i <= 100; ++i){ + for(var _i = 0; _i <= 100; ++_i){ console.log("."); } return -x | 0; diff --git a/jscomp/test/dist/jscomp/test/inline_record_test.js b/jscomp/test/dist/jscomp/test/inline_record_test.js index ef483ade3d..a8b23970b4 100644 --- a/jscomp/test/dist/jscomp/test/inline_record_test.js +++ b/jscomp/test/dist/jscomp/test/inline_record_test.js @@ -72,7 +72,7 @@ if (A0 === A0) { _1: [ "jscomp/test/inline_record_test.ml", 46, - 52 + 54 ], Error: new Error() }; @@ -100,7 +100,7 @@ var v5 = { z: 0 }; -for(var i = 0; i <= 10; ++i){ +for(var _i = 0; _i <= 10; ++_i){ ff(v4); ff(v5); } @@ -159,7 +159,7 @@ function ff0(x) { } -for(var i$1 = 0; i$1 <= 10; ++i$1){ +for(var _i$1 = 0; _i$1 <= 10; ++_i$1){ ff0(v6); } diff --git a/jscomp/test/dist/jscomp/test/int64_string_bench.js b/jscomp/test/dist/jscomp/test/int64_string_bench.js index cfa0ba93e0..148e305de4 100644 --- a/jscomp/test/dist/jscomp/test/int64_string_bench.js +++ b/jscomp/test/dist/jscomp/test/int64_string_bench.js @@ -12,7 +12,7 @@ var u = Caml_int64.sub(Stdlib__Int64.max_int, [ 200000 ]); -for(var i = 0; i <= 100000; ++i){ +for(var _i = 0; _i <= 100000; ++_i){ Caml_format.caml_int64_format("%d", u); } @@ -27,7 +27,7 @@ var u$1 = [ 30000000 ]; -for(var i$1 = 0; i$1 <= 100000; ++i$1){ +for(var _i$1 = 0; _i$1 <= 100000; ++_i$1){ Caml_format.caml_int64_format("%d", u$1); } @@ -42,7 +42,7 @@ var u$2 = Caml_int64.add(Stdlib__Int64.min_int, [ 100 ]); -for(var i$2 = 0; i$2 <= 100000; ++i$2){ +for(var _i$2 = 0; _i$2 <= 100000; ++_i$2){ Caml_format.caml_int64_format("%d", u$2); } diff --git a/jscomp/test/dist/jscomp/test/js_array_test.js b/jscomp/test/dist/jscomp/test/js_array_test.js index 667694418a..03267fad2c 100644 --- a/jscomp/test/dist/jscomp/test/js_array_test.js +++ b/jscomp/test/dist/jscomp/test/js_array_test.js @@ -6,7 +6,7 @@ var Js__Js_vector = require("melange.js/js_vector.js"); var Mt = require("./mt.js"); var suites_0 = [ - "File \"jscomp/test/js_array_test.ml\", line 3, characters 4-11", + "File \"jscomp/test/js_array_test.ml\", line 4, characters 4-11", (function (param) { var x = [ 1, @@ -30,7 +30,7 @@ var suites_0 = [ var suites_1 = { hd: [ - "File \"jscomp/test/js_array_test.ml\", line 11, characters 4-11", + "File \"jscomp/test/js_array_test.ml\", line 12, characters 4-11", (function (param) { var x = [ 1, diff --git a/jscomp/test/dist/jscomp/test/libarg_test.js b/jscomp/test/dist/jscomp/test/libarg_test.js index 568939711b..d01ec2ac89 100644 --- a/jscomp/test/dist/jscomp/test/libarg_test.js +++ b/jscomp/test/dist/jscomp/test/libarg_test.js @@ -17,7 +17,7 @@ var accum = { }; function record(fmt) { - return Stdlib__Printf.kprintf((function (s) { + return Stdlib__Printf.ksprintf((function (s) { accum.contents = { hd: s, tl: accum.contents diff --git a/jscomp/test/dist/jscomp/test/ppx_this_obj_field.js b/jscomp/test/dist/jscomp/test/ppx_this_obj_field.js index 9bdc39fe66..cf708b32ea 100644 --- a/jscomp/test/dist/jscomp/test/ppx_this_obj_field.js +++ b/jscomp/test/dist/jscomp/test/ppx_this_obj_field.js @@ -158,7 +158,7 @@ var test_type2 = { tl: test_type2_1 }; -eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 92, characters 5-12", [ +eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 94, characters 5-12", [ 6, v5.say() ]); @@ -175,7 +175,7 @@ var c = v.say(); v.incr(); -eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 99, characters 5-12", [ +eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 101, characters 5-12", [ [ 3, 4, @@ -194,7 +194,7 @@ z.setX(32); var bb = z.getX(); -eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 103, characters 5-12", [ +eq("File \"jscomp/test/ppx_this_obj_field.ml\", line 105, characters 5-12", [ [ 3, 32 diff --git a/jscomp/test/dist/jscomp/test/qcc.js b/jscomp/test/dist/jscomp/test/qcc.js index 0beafadd44..2c36470e7d 100644 --- a/jscomp/test/dist/jscomp/test/qcc.js +++ b/jscomp/test/dist/jscomp/test/qcc.js @@ -970,7 +970,7 @@ function unary(stk) { Error: new Error() }; } - for(var k = 1 ,k_finish = match[1]; k <= k_finish; ++k){ + for(var _k = 1 ,_k_finish = match[1]; _k <= _k_finish; ++_k){ Curry._1(next$1, undefined); } unary(stk); diff --git a/jscomp/test/dist/jscomp/test/record_extension_test.js b/jscomp/test/dist/jscomp/test/record_extension_test.js index f6a848528e..c4ec3e728c 100644 --- a/jscomp/test/dist/jscomp/test/record_extension_test.js +++ b/jscomp/test/dist/jscomp/test/record_extension_test.js @@ -34,7 +34,7 @@ var v0 = { y: "4" }; -eq("File \"jscomp/test/record_extension_test.ml\", line 19, characters 6-13", f(v0), 7); +eq("File \"jscomp/test/record_extension_test.ml\", line 18, characters 6-13", f(v0), 7); function f2(x) { if (typeof x === "number" || x.TAG !== /* C */0) { @@ -80,7 +80,7 @@ function u(f) { } } -Mt.from_pair_suites("File \"jscomp/test/record_extension_test.ml\", line 56, characters 22-29", suites.contents); +Mt.from_pair_suites("File \"jscomp/test/record_extension_test.ml\", line 55, characters 22-29", suites.contents); exports.suites = suites; exports.test_id = test_id; diff --git a/jscomp/test/dist/jscomp/test/test_for_loop.js b/jscomp/test/dist/jscomp/test/test_for_loop.js index ce6b3675c6..f49ef9bc80 100644 --- a/jscomp/test/dist/jscomp/test/test_for_loop.js +++ b/jscomp/test/dist/jscomp/test/test_for_loop.js @@ -95,7 +95,7 @@ function for_6(x, u) { contents: 0 }; v4.contents = v4.contents + 1 | 0; - for(var j = 0; j <= 1; ++j){ + for(var _j = 0; _j <= 1; ++_j){ v5.contents = v5.contents + 1 | 0; var v2 = { contents: 0 diff --git a/jscomp/test/dist/jscomp/test/test_primitive.js b/jscomp/test/dist/jscomp/test/test_primitive.js index e26edab5b8..1db0682339 100644 --- a/jscomp/test/dist/jscomp/test/test_primitive.js +++ b/jscomp/test/dist/jscomp/test/test_primitive.js @@ -8,14 +8,14 @@ var Stdlib = require("melange/stdlib.js"); function a4(prim) { return [ - "File \"jscomp/test/test_primitive.ml\", line 30, characters 9-19", + "File \"jscomp/test/test_primitive.ml\", line 29, characters 9-19", prim ]; } function a5(prim) { return [ - 31, + 30, prim ]; } @@ -24,7 +24,7 @@ function a6(prim) { return [ [ "jscomp/test/test_primitive.ml", - 32, + 31, 9, 19 ], @@ -84,11 +84,11 @@ function fib(n) { return (fib1 + fib2 | 0) + 3 | 0; } -var a0 = "File \"jscomp/test/test_primitive.ml\", line 26, characters 9-16"; +var a0 = "File \"jscomp/test/test_primitive.ml\", line 25, characters 9-16"; var a1 = "Test_primitive"; -var a2 = 28; +var a2 = 27; var a3 = "Test_primitive"; diff --git a/jscomp/test/dist/jscomp/test/test_static_catch_ident.js b/jscomp/test/dist/jscomp/test/test_static_catch_ident.js index f464d0ed63..bca232c218 100644 --- a/jscomp/test/dist/jscomp/test/test_static_catch_ident.js +++ b/jscomp/test/dist/jscomp/test/test_static_catch_ident.js @@ -13,7 +13,7 @@ function scanf_bad_input(ib, x) { } else { throw x; } - for(var i = 0; i <= 100; ++i){ + for(var _i = 0; _i <= 100; ++_i){ console.log(s); console.log("don't inlinie"); } diff --git a/jscomp/test/dist/jscomp/test/test_tuple.js b/jscomp/test/dist/jscomp/test/test_tuple.js index 7d4db5ba22..eb83ff1819 100644 --- a/jscomp/test/dist/jscomp/test/test_tuple.js +++ b/jscomp/test/dist/jscomp/test/test_tuple.js @@ -4,7 +4,7 @@ var r = 0; -for(var k = 1; k <= 10; ++k){ +for(var _k = 1; _k <= 10; ++_k){ for(var i = 1; i <= 10; ++i){ var match = i % 2 === 0 ? [ 1, diff --git a/jscomp/test/dune b/jscomp/test/dune index 3b056e9f8c..f59a1b7e05 100644 --- a/jscomp/test/dune +++ b/jscomp/test/dune @@ -18,11 +18,11 @@ (modules :standard \ mt) (melange.compile_flags -w - -3-6-9-20-26-27-30-32..39-52-61-67-69-106+104 + -27-32+104 -bs-no-version-header -bs-cross-module-opt)) -;; same as above but no preprocessing +;; same as above but no preprocessing with reason-react-ppx (subdir re_or_res @@ -33,10 +33,7 @@ (wrapped false) (preprocess (pps melange.ppx reason-react-ppx)) - (melange.compile_flags - -w - -3-6-9-20-26-27-30-32..39-52-61-67-69-106+104 - -bs-cross-module-opt))) + (melange.compile_flags -w -39+104 -bs-cross-module-opt))) (subdir es6_tests diff --git a/jscomp/test/equal_box_test.ml b/jscomp/test/equal_box_test.ml index 4bd2376180..2ac65b86f8 100644 --- a/jscomp/test/equal_box_test.ml +++ b/jscomp/test/equal_box_test.ml @@ -1,10 +1,7 @@ - - - external eqNull : 'a -> box:'a Js.null -> bool = "%bs_equal_null" external eqUndefined : 'a -> box:'a Js.undefined -> bool = "%bs_equal_undefined" -external eqNullable : 'a -> box:'a Js.nullable -> bool = "%bs_equal_nullable" +external eqNullable : 'a -> box:'a Js.nullable -> bool = "%bs_equal_nullable" let aa,bb,cc = eqNull, eqUndefined, eqNullable @@ -14,61 +11,61 @@ let aa,bb,cc = eqNull, eqUndefined, eqNullable let suites = ref [] let test_id =ref 0 -let eq loc x y = Mt.eq_suites ~suites ~test_id loc x y -let b loc x = Mt.bool_suites ~suites ~test_id loc x +let eq loc x y = Mt.eq_suites ~suites ~test_id loc x y +let b loc x = Mt.bool_suites ~suites ~test_id loc x -let f () = None -let shouldBeNull () = Js.null +let f () = None +let shouldBeNull () = Js.null -let () = +let () = b __LOC__ (not (eqNull 3 ~box:Js.null)); b __LOC__ (not (eqNull None ~box:Js.null)); - b __LOC__ (not (eqNull "3" Js.null)); - b __LOC__ (not (eqNull '3' Js.null)); - b __LOC__ (not (eqNull 0L Js.null)); - b __LOC__ (not (eqNull 0 Js.null)); - b __LOC__ (not (eqNull 0. Js.null)); - b __LOC__ (not (eqNull (f ()) Js.null)); - b __LOC__ ( (eqNull (shouldBeNull ()) Js.null)); - b __LOC__ (not (eqNull 1 (Js.Null.return 3))); - b __LOC__ ( (eqNull None (Js.Null.return None))); - b __LOC__ (not (eqNull (Some 3) (Js.Null.return None))) - -let () = - let v = Js.Nullable.null in + b __LOC__ (not (eqNull "3" ~box:Js.null)); + b __LOC__ (not (eqNull '3' ~box:Js.null)); + b __LOC__ (not (eqNull 0L ~box:Js.null)); + b __LOC__ (not (eqNull 0 ~box:Js.null)); + b __LOC__ (not (eqNull 0. ~box:Js.null)); + b __LOC__ (not (eqNull (f ()) ~box:Js.null)); + b __LOC__ ( (eqNull (shouldBeNull ()) ~box:Js.null)); + b __LOC__ (not (eqNull 1 ~box:(Js.Null.return 3))); + b __LOC__ ( (eqNull None ~box:(Js.Null.return None))); + b __LOC__ (not (eqNull (Some 3) ~box:(Js.Null.return None))) + +let () = + let v = Js.Nullable.null in b __LOC__ (not (eqNullable 3 ~box:v)); b __LOC__ (not (eqNullable None ~box:v)); - b __LOC__ (not (eqNullable "3" v)); - b __LOC__ (not (eqNullable '3' v)); - b __LOC__ (not (eqNullable 0L v)); - b __LOC__ (not (eqNullable 0 v)); - b __LOC__ (not (eqNullable 0. v)); - b __LOC__ (not (eqNullable (f ()) v)); - b __LOC__ ( (eqNullable (shouldBeNull ()) v)); - b __LOC__ (not (eqNullable 1 (Js.Nullable.return 3))); - b __LOC__ ( (eqNullable None (Js.Nullable.return None))); - b __LOC__ (not (eqNullable (Some 3) (Js.Nullable.return None))) - -let () = - let v = Js.Undefined.empty in - + b __LOC__ (not (eqNullable "3" ~box:v)); + b __LOC__ (not (eqNullable '3' ~box:v)); + b __LOC__ (not (eqNullable 0L ~box:v)); + b __LOC__ (not (eqNullable 0 ~box:v)); + b __LOC__ (not (eqNullable 0. ~box:v)); + b __LOC__ (not (eqNullable (f ()) ~box:v)); + b __LOC__ ( (eqNullable (shouldBeNull ()) ~box:v)); + b __LOC__ (not (eqNullable 1 ~box:(Js.Nullable.return 3))); + b __LOC__ ( (eqNullable None ~box:(Js.Nullable.return None))); + b __LOC__ (not (eqNullable (Some 3) ~box:(Js.Nullable.return None))) + +let () = + let v = Js.Undefined.empty in + b __LOC__ (not (eqUndefined 3 ~box:v)); b __LOC__ ((eqUndefined None ~box:v)); - b __LOC__ (not (eqUndefined "3" v)); - b __LOC__ (not (eqUndefined '3' v)); - b __LOC__ (not (eqUndefined 0L v)); - b __LOC__ (not (eqUndefined 0 v)); - b __LOC__ (not (eqUndefined 0. v)); - b __LOC__ ((eqUndefined (f ()) v)); + b __LOC__ (not (eqUndefined "3" ~box:v)); + b __LOC__ (not (eqUndefined '3' ~box:v)); + b __LOC__ (not (eqUndefined 0L ~box:v)); + b __LOC__ (not (eqUndefined 0 ~box:v)); + b __LOC__ (not (eqUndefined 0. ~box:v)); + b __LOC__ ((eqUndefined (f ()) ~box:v)); (* [ None === undefined] [ None === Js.Undefined.return None] *) - b __LOC__ (not (eqUndefined (shouldBeNull ()) v)); - b __LOC__ (not (eqUndefined 1 (Js.Undefined.return 3))); - b __LOC__ ( (eqUndefined None (Js.Undefined.return None))); - b __LOC__ (not (eqUndefined (Some 3) (Js.Undefined.return None))) + b __LOC__ (not (eqUndefined (shouldBeNull ()) ~box:v)); + b __LOC__ (not (eqUndefined 1 ~box:(Js.Undefined.return 3))); + b __LOC__ ( (eqUndefined None ~box:(Js.Undefined.return None))); + b __LOC__ (not (eqUndefined (Some 3) ~box:(Js.Undefined.return None))) + - -;; Mt.from_pair_suites __LOC__ !suites +;; Mt.from_pair_suites __LOC__ !suites diff --git a/jscomp/test/exception_raise_test.ml b/jscomp/test/exception_raise_test.ml index 51813a5cb3..0617d2989c 100644 --- a/jscomp/test/exception_raise_test.ml +++ b/jscomp/test/exception_raise_test.ml @@ -4,7 +4,7 @@ exception Local exception B of int list exception C of int * int exception D of (int * int) -let appf g x = +let[@ocaml.warning "-38"] appf g x = let module U = struct exception A of int end in diff --git a/jscomp/test/exception_rebound_err_test.ml b/jscomp/test/exception_rebound_err_test.ml index 0e76741d0a..f4b7be9213 100644 --- a/jscomp/test/exception_rebound_err_test.ml +++ b/jscomp/test/exception_rebound_err_test.ml @@ -1,25 +1,25 @@ let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = - incr test_id ; - suites := +let eq loc x y = + incr test_id ; + suites := (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites -exception A of int -exception B -exception C of int * int +exception A of int +exception B +exception C of int * int -let test_js_error4 () = +let[@ocaml.warning "-52"] test_js_error4 () = try ignore @@ Js.Json.parseExn {| {"x"}|}; 1 with | Not_found -> 2 - | Invalid_argument "x" -> 3 + | Invalid_argument "x" -> 3 | A 2 -> 4 - | B -> 5 + | B -> 5 | C (1,2) -> 6 | e -> 7 -let f g = - try g () with Not_found -> 1 +let f g = + try g () with Not_found -> 1 ;; eq __LOC__ (test_js_error4 () ) 7 -;; Mt.from_pair_suites __MODULE__ !suites \ No newline at end of file +;; Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/ext_string_test.ml b/jscomp/test/ext_string_test.ml index 628eab1bb1..b7bb117c0e 100644 --- a/jscomp/test/ext_string_test.ml +++ b/jscomp/test/ext_string_test.ml @@ -224,7 +224,6 @@ let non_overlap_count ~sub s = let rfind ~sub s = let n = String.length sub in let i = ref (String.length s - n) in - let module M = struct exception Exit end in try while !i >= 0 do if unsafe_is_sub ~sub 0 s !i ~len:n then @@ -415,7 +414,7 @@ let replace_backward_slash (x : string)= let empty = "" -external compare : string -> string -> int = "caml_string_length_based_compare" "noalloc";; +external compare : string -> string -> int = "caml_string_length_based_compare" [@@noalloc];; let single_space = " " let single_colon = ":" diff --git a/jscomp/test/fib.ml b/jscomp/test/fib.ml index 9fec74e830..ac0562b1eb 100644 --- a/jscomp/test/fib.ml +++ b/jscomp/test/fib.ml @@ -1,17 +1,17 @@ let rec fib = function - | 0 | 1 -> 1 + | 0 | 1 -> 1 | n -> fib (n - 1) + fib (n - 2) -let fib2 n = - let rec aux a b i = - if n = i then a +let fib2 n = + let rec aux a b i = + if n = i then a else aux b (a+b) (i + 1) in aux 1 1 0 -let fib3 n = +let fib3 n = let a = ref 1 in let b = ref 1 in - for i = 1 to n do + for _i = 1 to n do let tmp = !a in a := !b; b := !b + tmp diff --git a/jscomp/test/flattern_order_test.ml b/jscomp/test/flattern_order_test.ml index 9892415488..b408272755 100644 --- a/jscomp/test/flattern_order_test.ml +++ b/jscomp/test/flattern_order_test.ml @@ -28,7 +28,7 @@ type t = } let v = ref 0 -let rec obj = +let obj = { get = (fun _ -> !v); set = (fun i -> v := i ) } diff --git a/jscomp/test/for_loop_test.ml b/jscomp/test/for_loop_test.ml index 211b82f64f..78ef66816b 100644 --- a/jscomp/test/for_loop_test.ml +++ b/jscomp/test/for_loop_test.ml @@ -1,21 +1,19 @@ - - -let for_3 x = +let for_3 x = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x - 1 do + for i = 0 to Array.length x - 1 do let j = i * 2 in arr.(i) <- (fun _ -> v := !v + j) done; Array.iter (fun x -> x ()) arr; !v - -let for_4 x = + +let for_4 x = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x - 1 do + for i = 0 to Array.length x - 1 do let j = i * 2 in let k = 2 * j in arr.(i) <- (fun _ -> v := !v + k) @@ -23,10 +21,10 @@ let for_4 x = Array.iter (fun x -> x ()) arr; !v -let for_5 x u = +let for_5 x u = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x - 1 do + for i = 0 to Array.length x - 1 do let _j = i * 2 in let k = 2 * u * u in arr.(i) <- (fun _ -> v := !v + k) @@ -35,41 +33,41 @@ let for_5 x u = !v -let for_6 x u = +let for_6 x u = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in let v4 = ref 0 in let v5 = ref 0 in let inspect_3 = ref (-1) in - incr v4; - for j = 0 to 1 do - incr v5 ; + incr v4; + for _j = 0 to 1 do + incr v5 ; let v2 = ref 0 in let v3 = u in - for i = 0 to Array.length x - 1 do + for i = 0 to Array.length x - 1 do let _j = i * 2 in let k = 2 * u * u in let h = 2 * !v5 in - incr v2; + incr v2; arr.(i) <- (fun _ -> v := !v + k + !v2 + !v4 + !v5 + h + v3) (* v2 should not be captured *) - done; + done; inspect_3 := !v2; done; Array.iter (fun x -> x ()) arr; [|!v; !v4 ; !v5; !inspect_3 |] -let for_7 () = +let for_7 () = let i_len = 7 in - let j_len = 3 in - let v = ref 0 in + let j_len = 3 in + let v = ref 0 in let arr = Array.make (i_len * j_len) (fun _ -> ()) in - for i = 0 to i_len - 1 do - + for i = 0 to i_len - 1 do + for j = 0 to j_len - 1 do - arr.(i * j_len + j) <- - (fun _ -> - begin + arr.(i * j_len + j) <- + (fun _ -> + begin (* print_endline @@ Printf.sprintf "%d %d" i j; *) (* print_endline @@ string_of_int ( i * j_len + j) ^ " " *) (* ^ (string_of_int i) ^ " " ^ string_of_int j; *) @@ -81,18 +79,18 @@ let for_7 () = !v -let for_8 () = +let for_8 () = let i_len = 7 in - let j_len = 3 in - let v = ref 0 in + let j_len = 3 in + let v = ref 0 in let arr = Array.make (i_len * j_len) (fun _ -> ()) in - for i = 0 to i_len - 1 do + for i = 0 to i_len - 1 do let k = 2 * i in for j = 0 to j_len - 1 do let h = i + j in - arr.(i * j_len + j) <- - (fun _ -> - begin + arr.(i * j_len + j) <- + (fun _ -> + begin (* prerr_endline @@ Printf.sprintf "%d %d" i j; *) v:= !v + i + j + h + k end) @@ -102,8 +100,8 @@ let for_8 () = !v -let for_9 () = - let collect, get = +let for_9 () = + let collect, get = let v : int list ref = ref [] in (fun x -> v := x::!v) , (fun () -> Array.of_list @@ List.rev !v) in @@ -116,33 +114,33 @@ let for_9 () = for i = 0 to i_len - 1 do let v = ref 0 in (* incr v ; *) - v := !v + i ; + v := !v + i ; for j = 0 to j_len - 1 do incr v ; collect !v ; - arr.(i * j_len + j)<- - fun _ -> + arr.(i * j_len + j)<- + fun _ -> (* prerr_endline @@ Printf.sprintf "<%d" !vv ; *) (* prerr_endline @@ Printf.sprintf ">%d" !vv ; *) - vv := !vv + !v; - (* v should not be captured inside , - since for next iteration, + vv := !vv + !v; + (* v should not be captured inside , + since for next iteration, we are bound the same v there are four iterations of this function - - the first two bound one v + + the first two bound one v the second two bound the other one - -- sometimes it's hard to tell the difference, + -- sometimes it's hard to tell the difference, when v is not relevant to the outer [index] actually we have to lexical scope the whole for statement *) done; - arr2.(i) <- fun _ -> vv2 := !vv2 + !v ; - (* v should be captured, since next iteration + arr2.(i) <- fun _ -> vv2 := !vv2 + !v ; + (* v should be captured, since next iteration v is changed *) done; @@ -178,7 +176,7 @@ console.log(result,u) let suites = [ -"for_loop_test_3", (fun _ -> +"for_loop_test_3", (fun _ -> Mt.Eq (90, (for_3 @@ Array.make 10 2);)); "for_loop_test_4", (fun _ -> Mt.Eq (180, (for_4 @@ Array.make 10 2))); @@ -192,6 +190,6 @@ let suites = [ "for_loop_test_8", (fun _ -> Mt.Eq(294, (for_8 ()))); -"for_loop_test_9", (fun _ -> +"for_loop_test_9", (fun _ -> Mt.Eq([|10,[|1;2;2;3|], 5|], (for_9 ()))) ] diff --git a/jscomp/test/for_side_effect_test.ml b/jscomp/test/for_side_effect_test.ml index 4b787b1c28..1b1e42a942 100644 --- a/jscomp/test/for_side_effect_test.ml +++ b/jscomp/test/for_side_effect_test.ml @@ -1,15 +1,14 @@ let tst () = - for i = (print_endline"hi"; 0) to (print_endline "hello"; 3) do () done;; + for _i = (print_endline"hi"; 0) to (print_endline "hello"; 3) do () done;; -let test2 () = +let test2 () = let v = ref 0 in - for i = (v:=3; 0) to (v:=10;1) do + for _i = (v:=3; 0) to (v:=10;1) do () done; !v -open Mt let suites = Mt. [ "for_order", (fun _ -> Eq (10, (test2 ())))] @@ -26,6 +25,6 @@ Mt.from_pair_suites __MODULE__ suites while(i ++ <= length){ } - + ]} *) diff --git a/jscomp/test/functor_def.ml b/jscomp/test/functor_def.ml index 3ed7f6d35a..c79afff1d1 100644 --- a/jscomp/test/functor_def.ml +++ b/jscomp/test/functor_def.ml @@ -1,19 +1,17 @@ - let v = ref 0 -let f x x = - incr v ; - x + x +let f x x = + incr v ; + x + x -let return () = !v +let return () = !v module Make (U : sig - type t - val say : int -> int -> int - end ) = struct + val say : int -> int -> int + end ) = struct (* let () = Js.log "no inline" *) - let h x x = + let h x x = Js.log (f x x); U.say x x -end +end diff --git a/jscomp/test/functors.ml b/jscomp/test/functors.ml index 16f57eff99..b316fcf9e0 100644 --- a/jscomp/test/functors.ml +++ b/jscomp/test/functors.ml @@ -33,9 +33,10 @@ end [@@inline always] module M : sig module F (X : S1) (Y : S1) : T + [@@ocaml.warning "-67"] end = struct module F (X : S) (Y : S) = struct let cow x = Y.foo (X.foo x) let sheep x = 1 + cow x end [@@inline always] -end \ No newline at end of file +end diff --git a/jscomp/test/gpr_1245_test.ml b/jscomp/test/gpr_1245_test.ml index 6d7e2f799b..a6f9e8e44f 100644 --- a/jscomp/test/gpr_1245_test.ml +++ b/jscomp/test/gpr_1245_test.ml @@ -1,11 +1,11 @@ let (a,b) = 1,2 -let (x,y) = ref a , ref b +let (x,y) = ref a , ref b -let f (c,d) = - let (a,b) = ref c, ref d in - Js.log2 a b +let f (c,d) = + let (a,b) = ref c, ref d in + Js.log2 a b (** escape analysis to avoid allocation @@ -13,10 +13,10 @@ let f (c,d) = let match/xx = [a,b,c] ]} later if [match/xx] is only used in destructring - [Pfield match/xx i] then there is no need to construct + [Pfield match/xx i] then there is no need to construct such block. - It is more general than + It is more general than [Js.Null.toOption] since its box number is one and immutable, so we can give it a meaningful name for such slot @@ -24,24 +24,23 @@ let f (c,d) = This also applies to [reference] exception allocation *) - -type t = { x : int ; y : int} +type t = { x : int ; y : int} -let g () = - let z = { x = 1 ; y = 2} in + +let g () = + let z = { x = 1 ; y = 2} in z.x + z.y let a0 f = - let u = Js.Null.toOption (f ()) in - match u with + let u = Js.Null.toOption (f ()) in + match u with | None -> 0 - | Some x -> Js.log x ; Js.log x ; 1 + | Some x -> Js.log x ; Js.log x ; 1 -let a1 f = - let module M = struct exception E end in - try +let[@ocaml.warning "-38"] a1 f = + let module M = struct exception E end in + try f () - with M.E -> 1 - + with M.E -> 1 diff --git a/jscomp/test/gpr_1600_test.ml b/jscomp/test/gpr_1600_test.ml index e7b1e10409..39842ff02d 100644 --- a/jscomp/test/gpr_1600_test.ml +++ b/jscomp/test/gpr_1600_test.ml @@ -1,10 +1,7 @@ - - - let f : (int * int -> int [@u]) = fun [@u] x -> let a,b = x in a + b -let obj : < hi : (int * int -> unit [@mel.meth]) > Js.t = object +let[@ocaml.warning "-61"] obj : < hi : (int * int -> unit [@mel.meth]) > Js.t = object method hi (x : int * int) = Js.log x end [@u] (** expect *) diff --git a/jscomp/test/gpr_1667_test.ml b/jscomp/test/gpr_1667_test.ml index 30d5384827..e3a8f41e07 100644 --- a/jscomp/test/gpr_1667_test.ml +++ b/jscomp/test/gpr_1667_test.ml @@ -1,20 +1,20 @@ let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = - incr test_id ; - suites := +let eq loc x y = + incr test_id ; + suites := (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites ;; -let i = - (let e = (=) - (let o = false in - (fun z -> - (let m = () in fun n -> 0) +let i = + (let _e = (=) + (let o = false in + (fun z -> + (let _m = () in fun n -> 0) (fun q -> fun y -> o)) o) 0 in 0) -in eq __LOC__ i 0 +in eq __LOC__ i 0 -;; Mt.from_pair_suites __MODULE__ !suites \ No newline at end of file +;; Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/gpr_1692_test.ml b/jscomp/test/gpr_1692_test.ml index 1740fa1b28..1abf99ae83 100644 --- a/jscomp/test/gpr_1692_test.ml +++ b/jscomp/test/gpr_1692_test.ml @@ -1,6 +1,6 @@ -(let _s = - (let h = true in - fun x -> - let j = fun f -> true in +(let _s = + (let _h = true in + fun x -> + let _j = fun f -> true in fun f -> 0) "" "" in - ()) \ No newline at end of file + ()) diff --git a/jscomp/test/gpr_1698_test.ml b/jscomp/test/gpr_1698_test.ml index 9e7c408d77..e65185a439 100644 --- a/jscomp/test/gpr_1698_test.ml +++ b/jscomp/test/gpr_1698_test.ml @@ -4,7 +4,7 @@ type value = | Symbol of string type context = | InSum -type t = +type [@ocaml.warning "-37"]t = | Val of value | Neg of t | Sum of t list @@ -45,7 +45,7 @@ let rec compare context state a b = | _ -> assert false) let a = ((Sum ([sym "a"; Val (Natural 2) ])) ) let b = sym "x" -type st = { +type[@ocaml.warning "-69"] st = { complex: bool;} let empty () = { complex = true } let _ = Js.log @@ (compare InSum (empty ()) a b) diff --git a/jscomp/test/gpr_2503_test.ml b/jscomp/test/gpr_2503_test.ml index fb84c56ec0..0779b42910 100644 --- a/jscomp/test/gpr_2503_test.ml +++ b/jscomp/test/gpr_2503_test.ml @@ -12,7 +12,7 @@ let makeWrapper ?foo () = Js.log (make ?foo ()) external make2: foo:([`a|`b] ) -> unit -> _ = "" [@@mel.obj] -let makeWrapper2 foo () = Js.log (make2 foo ()) +let makeWrapper2 foo () = Js.log (make2 ~foo ()) let _ = makeWrapper2 `a () diff --git a/jscomp/test/gpr_4280_test.ml b/jscomp/test/gpr_4280_test.ml index 3321b2ce84..b1690d2ccc 100644 --- a/jscomp/test/gpr_4280_test.ml +++ b/jscomp/test/gpr_4280_test.ml @@ -4,13 +4,13 @@ let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y let u = ref 0 let div ~children () = - for i = 0 to 1 do + for _i = 0 to 1 do u := 300; Js.log "nonline" done let string (s : string) = - for i = 0 to 1 do + for _i = 0 to 1 do u := 200; Js.log "no" done diff --git a/jscomp/test/gpr_4491_test.ml b/jscomp/test/gpr_4491_test.ml index d24b892374..f005747838 100644 --- a/jscomp/test/gpr_4491_test.ml +++ b/jscomp/test/gpr_4491_test.ml @@ -1,7 +1,7 @@ let f xs = - let unused = + let _unused = match xs with | Some (l) -> Js.log "side effect"; [l; l] | None -> [1; 2] in - Js.log2 "nothing to see here" xs \ No newline at end of file + Js.log2 "nothing to see here" xs diff --git a/jscomp/test/gpr_4900_test.ml b/jscomp/test/gpr_4900_test.ml index b7bd0222c4..d72580b79c 100644 --- a/jscomp/test/gpr_4900_test.ml +++ b/jscomp/test/gpr_4900_test.ml @@ -1,19 +1,17 @@ - - let {from_pair_suites;eq_suites} = (module Mt ) let suites = ref [] let id = ref 0 -type show = | No | After of int | Yes +type show = | No | After of int | Yes -let showToJs x = - match x with - | Yes | After _ -> true +let showToJs x = + match x with + | Yes | After _ -> true | No -> false -;; eq_suites id suites __LOC__ (showToJs Yes) true -;; eq_suites id suites __LOC__ (showToJs No) false -;; eq_suites id suites __LOC__ (showToJs (After 3)) true +;; eq_suites ~test_id:id ~suites __LOC__ (showToJs Yes) true +;; eq_suites ~test_id:id ~suites __LOC__ (showToJs No) false +;; eq_suites ~test_id:id ~suites __LOC__ (showToJs (After 3)) true -;; from_pair_suites __LOC__ !suites \ No newline at end of file +;; from_pair_suites __LOC__ !suites diff --git a/jscomp/test/gpr_4924_test.ml b/jscomp/test/gpr_4924_test.ml index e4235694bb..27d77564b0 100644 --- a/jscomp/test/gpr_4924_test.ml +++ b/jscomp/test/gpr_4924_test.ml @@ -2,48 +2,48 @@ let {from_pair_suites;eq_suites} = (module Mt ) let suites = ref [] let id = ref 0 -type t = - | A - | B - | C of int -let u b = - match b with - | A -> 0 +type t = + | A + | B + | C of int +let u b = + match b with + | A -> 0 | B | C _ -> 1 - -let u1 b = - match b with - | A -> true - | B | C _ -> false - - -let u2 b = - match b with - | A -> false - | B | C _ -> true - -;; eq_suites id suites __LOC__ (u2 A) false -;; eq_suites id suites __LOC__ (u2 B ) true -;; eq_suites id suites __LOC__ (u2 (C 2)) true -let u3 b = - match b with - | A -> 3 + +let u1 b = + match b with + | A -> true + | B | C _ -> false + + +let u2 b = + match b with + | A -> false + | B | C _ -> true + +;; eq_suites ~test_id:id ~suites __LOC__ (u2 A) false +;; eq_suites ~test_id:id ~suites __LOC__ (u2 B ) true +;; eq_suites ~test_id:id ~suites __LOC__ (u2 (C 2)) true +let u3 b = + match b with + | A -> 3 | B | C _ -> 4 -let u4 b = - match b with - | A -> 3 - | _ -> 4 +let u4 b = + match b with + | A -> 3 + | _ -> 4 -let u5 b = - match b with +let u5 b = + match b with | A -> false | _ -> true -let u6 b = - match b with +let u6 b = + match b with | A -> true | _ -> false -;; from_pair_suites __LOC__ !suites \ No newline at end of file +;; from_pair_suites __LOC__ !suites diff --git a/jscomp/test/gpr_977_test.ml b/jscomp/test/gpr_977_test.ml index 8268abb54a..c479930793 100644 --- a/jscomp/test/gpr_977_test.ml +++ b/jscomp/test/gpr_977_test.ml @@ -1,35 +1,35 @@ let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = - incr test_id ; - suites := +let eq loc x y = + incr test_id ; + suites := (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites -let f x = - for i = 0 to 100 do +let f x = + for _i = 0 to 100 do Js.log "." ; (* prevent optimization*) - done; + done; - x let int32_f x = - for i = 0 to 100 do + for _i = 0 to 100 do Js.log "." ; (* prevent optimization*) - done; - Int32.neg x + done; + Int32.neg x (* let nint32_f x = - for i = 0 to 100 do + for i = 0 to 100 do Js.log "." ; (* prevent optimization*) - done; + done; Nativeint.neg x *) let min_32_int = (-2147483648) let u = f min_32_int -let () = +let () = eq __LOC__ min_32_int u ; eq __LOC__ (Int32.min_int) (int32_f Int32.min_int) (* eq __LOC__ (nint32_f (-2147483648n)) (2147483648n) *) -let () = Mt.from_pair_suites __MODULE__ !suites \ No newline at end of file +let () = Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/inline_record_test.ml b/jscomp/test/inline_record_test.ml index b9085c4972..9ab889a9b0 100644 --- a/jscomp/test/inline_record_test.ml +++ b/jscomp/test/inline_record_test.ml @@ -43,7 +43,7 @@ type t3 = let vvv : t3 = A0 {lbl = 3; more = []} -;; eq __LOC__ (match v3 with A0 {lbl} -> lbl | _ -> assert false) 3 +;; eq __LOC__ (match v3 with A0 {lbl;_} -> lbl | _ -> assert false) 3 type t4 = | A0 of { mutable x : int; y :int ; mutable z : int } @@ -57,7 +57,7 @@ let ff (x : t4) = let v4 : t4 = A0 { x = 0; y = 0; z = 0} let v5 : t4 = A1 { z = 0 } -;; for i = 0 to 10 do +;; for _i = 0 to 10 do ff v4; ff v5 done @@ -75,7 +75,7 @@ let ff0 (x : exn) = | A4 u -> u.x <- u.x + 1 ; u.z <- u.z + 1 | _ -> () -;; for i = 0 to 10 do +;; for _i = 0 to 10 do ff0 v6 done diff --git a/jscomp/test/inline_string_test.ml b/jscomp/test/inline_string_test.ml index 236304044b..892ec19cb5 100644 --- a/jscomp/test/inline_string_test.ml +++ b/jscomp/test/inline_string_test.ml @@ -1,5 +1,5 @@ [@@@mel.config{no_export}] -type t = +type [@ocaml.warning "-37"]t = | A_list | A_hashtable @@ -11,7 +11,7 @@ let string_of_associative_type = function ;; Js.log (string_of_associative_type A_list) -type t2 = +type[@ocaml.warning "-37"] t2 = | A_list | A_hashtable | A_bad @@ -32,7 +32,7 @@ let f = function let u v = f (Some v ) ;; Js.log (f v, f None, f (Some 3)) -type v = +type [@ocaml.warning "-37"] v = | A of int | B of int | C of int diff --git a/jscomp/test/inner_unused.ml b/jscomp/test/inner_unused.ml index 42d367b29d..1bdde91056 100644 --- a/jscomp/test/inner_unused.ml +++ b/jscomp/test/inner_unused.ml @@ -1,17 +1,14 @@ - - - -let f x = - let unused_f x = Js.log "x" ; x + x in - let unused_h x = unused_f 3 in +let f x = + let unused_f x = Js.log "x" ; x + x in + let _unused_h x = unused_f 3 in x + 3 module M (S : Set.S) : sig - val f : int -> int + val f : int -> int end = struct - let f x = x + let f x = x let unused_g x = x + 2 - let unused_h x= unused_g x -end + let unused_h x= unused_g x +end -let fff _ _ = 3 \ No newline at end of file +let fff _ _ = 3 diff --git a/jscomp/test/int64_string_bench.ml b/jscomp/test/int64_string_bench.ml index 896e5cbd13..2c8cd32899 100644 --- a/jscomp/test/int64_string_bench.ml +++ b/jscomp/test/int64_string_bench.ml @@ -1,30 +1,27 @@ - - -let () = +let () = Js.Console.timeStart "Int64.to_string"; - let u = Int64.( max_int |. sub 200_000L) in + let u = Int64.( max_int |. sub 200_000L) in (* let u = 3L in *) - for i = 0 to 1_00_000 do + for _i = 0 to 1_00_000 do Int64.to_string u |> ignore done ; Js.Console.timeEnd "Int64.to_string"; Js.log (Int64.to_string u) let () = Js.Console.timeStart "Int64.to_string"; - let u = 30_000_000L in - for i = 0 to 1_00_000 do + let u = 30_000_000L in + for _i = 0 to 1_00_000 do Int64.to_string u |> ignore done ; Js.Console.timeEnd "Int64.to_string"; Js.log (Int64.to_string u) -let () = +let () = Js.Console.timeStart "Int64.to_string"; - let u = Int64.(min_int |. add 100L) in - for i = 0 to 1_00_000 do + let u = Int64.(min_int |. add 100L) in + for _i = 0 to 1_00_000 do Int64.to_string u |> ignore done ; Js.Console.timeEnd "Int64.to_string"; Js.log (Int64.to_string u) - diff --git a/jscomp/test/int_hashtbl_test.ml b/jscomp/test/int_hashtbl_test.ml index 8d3770e36b..fceaf8938f 100644 --- a/jscomp/test/int_hashtbl_test.ml +++ b/jscomp/test/int_hashtbl_test.ml @@ -1,34 +1,32 @@ -open Hashtbl - module type S = Hashtbl.S with type key = int (* -let to_list (module H : S) (tbl : 'a H.t) = +let to_list (module H : S) (tbl : 'a H.t) = H.fold (fun k v acc -> (k,v)::acc) tbl [] *) -let f (module H : Hashtbl.S with type key = int) = +let f (module H : Hashtbl.S with type key = int) = (* let module Hashtbl = (val Hashtbl) in *) let tbl = H.create 17 in H.add tbl 1 '1'; H.add tbl 2 '2'; - List.sort (fun ((a : int),_) (b,_) -> compare a b ) + List.sort (fun ((a : int),_) (b,_) -> compare a b ) @@ H.fold (fun k v acc -> (k,v)::acc) tbl [] -let g (module H : S) count = +let g (module H : S) count = let tbl = H.create 17 in - for i = 0 to count do + for i = 0 to count do H.replace tbl (i * 2) (string_of_int i) done; - for i = 0 to count do + for i = 0 to count do H.replace tbl (i * 2) (string_of_int i) done; let v = H.fold (fun k v acc -> (k,v)::acc) tbl [] in let v = List.sort (fun (x, _) ((y : int), _) -> compare x y) @@ v in Array.of_list v - -module Int_hash = - Hashtbl.Make( struct type t = int + +module Int_hash = + Hashtbl.Make( struct type t = int let hash x = Hashtbl.hash x let equal (x : int) y = x = y end) @@ -36,11 +34,11 @@ module Int_hash = let suites = Mt.[ "simple", (fun _ -> Eq ([1,'1';2,'2'], f (module Int_hash ))); - "more_iterations", - (fun _ -> + "more_iterations", + (fun _ -> let count = 1000 in - Eq( Array.init (count + 1) (fun i -> (2 * i, string_of_int i) ), + Eq( Array.init (count + 1) (fun i -> (2 * i, string_of_int i) ), g (module Int_hash) count)) ] - + ;; Mt.from_pair_suites __MODULE__ suites diff --git a/jscomp/test/js_array_test.ml b/jscomp/test/js_array_test.ml index 85e2a5bc8c..c2780c0f94 100644 --- a/jscomp/test/js_array_test.ml +++ b/jscomp/test/js_array_test.ml @@ -1,3 +1,4 @@ +[@@@ocaml.warning "-3"] let suites = Mt.[ __LOC__ , (fun _ -> diff --git a/jscomp/test/js_date_test.ml b/jscomp/test/js_date_test.ml index 274f8b540b..f104a42ca3 100644 --- a/jscomp/test/js_date_test.ml +++ b/jscomp/test/js_date_test.ml @@ -1,4 +1,3 @@ - module N = Js.Date let date () = @@ -438,7 +437,7 @@ let suites = Mt.[ "toISOString", (fun _ -> Eq("1976-03-08T11:11:56.789Z", N.toISOString (date ()))); "toJSON", (fun _ -> - Eq("1976-03-08T11:11:56.789Z", N.toJSON (date ()))); + Eq("1976-03-08T11:11:56.789Z", N.toJSON (date ()) [@ocaml.warning "-3"])); "toJSONUnsafe", (fun _ -> Eq("1976-03-08T11:11:56.789Z", N.toJSONUnsafe (date ()))); (* locale dependent diff --git a/jscomp/test/js_exception_catch_test.ml b/jscomp/test/js_exception_catch_test.ml index 47b5276c6c..fd79369ac7 100644 --- a/jscomp/test/js_exception_catch_test.ml +++ b/jscomp/test/js_exception_catch_test.ml @@ -1,14 +1,14 @@ let suites : Mt.pair_suites ref = ref [] -let add_test = +let add_test = let counter = ref 0 in - fun loc test -> - incr counter; - let id = (loc ^ " id " ^ (string_of_int !counter)) in + fun loc test -> + incr counter; + let id = (loc ^ " id " ^ (string_of_int !counter)) in suites := (id, test) :: ! suites -let eq loc x y = - add_test loc (fun _ -> Mt.Eq (x, y)) +let eq loc x y = + add_test loc (fun _ -> Mt.Eq (x, y)) let false_ loc = add_test loc (fun _ -> Mt.Ok false) @@ -16,17 +16,17 @@ let true_ loc = add_test loc (fun _ -> Mt.Ok true) let () = - match Js.Json.parseExn {| {"x"}|} with - | exception Js.Exn.Error x -> + match Js.Json.parseExn {| {"x"}|} with + | exception Js.Exn.Error x -> true_ __LOC__ | e -> false_ __LOC__ -exception A of int -exception B -exception C of int * int +exception A of int +exception B +exception C of int * int -let test f = +let[@ocaml.warning "-52"] test f = try f (); `No_error with | Not_found -> `Not_found | Invalid_argument "x" -> `Invalid_argument @@ -39,7 +39,7 @@ let test f = | Js.Exn.Error _ -> `Js_error | e -> `Any -let () = +let () = eq __LOC__ (test (fun _ -> ())) `No_error; eq __LOC__ (test (fun _ -> raise Not_found)) `Not_found; eq __LOC__ (test (fun _ -> invalid_arg "x")) `Invalid_argument; diff --git a/jscomp/test/js_re_test.ml b/jscomp/test/js_re_test.ml index 33f5d7008b..d5c84949df 100644 --- a/jscomp/test/js_re_test.ml +++ b/jscomp/test/js_re_test.ml @@ -1,4 +1,3 @@ - let suites = Mt.[ "captures", (fun _ -> let re = [%re "/(\\d+)-(?:(\\d+))?/g"] in @@ -45,13 +44,13 @@ let suites = Mt.[ ); "fromStringWithFlags", (fun _ -> - let res = Js.Re.fromStringWithFlags "foo" "g" in + let res = Js.Re.fromStringWithFlags "foo" ~flags:"g" in Eq(true, res |. Js.Re.global) ); "result_index", (fun _ -> match "zbar" |. Js.Re.fromString |. Js.Re.exec_ "foobarbazbar" with - | Some res -> + | Some res -> Eq(8, res |> Js.Re.index) | None -> Fail () @@ -60,7 +59,7 @@ let suites = Mt.[ let input = "foobar" in match [%re "/foo/g"] |. Js.Re.exec_ input with - | Some res -> + | Some res -> Eq(input, res |> Js.Re.input) | None -> Fail () diff --git a/jscomp/test/lexer_test.ml b/jscomp/test/lexer_test.ml index 0b34936016..b2b19683e4 100644 --- a/jscomp/test/lexer_test.ml +++ b/jscomp/test/lexer_test.ml @@ -1,39 +1,38 @@ - -let get_tokens lex str = +let get_tokens lex str = let buf = Lexing.from_string str in - let rec aux acc = + let rec aux acc = let v = lex buf in - if v = Arith_parser.EOF then - List.rev acc + if v = Arith_parser.EOF then + List.rev acc else aux (v :: acc) in aux [] -let f = get_tokens Arith_lexer.lexeme +let f = get_tokens Arith_lexer.lexeme -let from_tokens lst = +let from_tokens lst = let l = ref lst in - let rec aux () = - match !l with - | [] -> raise End_of_file + let aux () = + match !l with + | [] -> raise End_of_file | y::ys -> l := ys; y in - aux + aux (* let wrap parse f = *) (* (Lexing.lexbuf -> Arith_parser.token) -> *) (* Lexing.lexbuf -> Arith_syntax.expression *) -let lexer_suites = +let lexer_suites = Mt.[ - "arith_token", (fun _ -> + "arith_token", (fun _ -> Eq( f "x + 3 + 4 + y", [IDENT "x"; PLUS; NUMERAL 3.; PLUS; NUMERAL 4.; PLUS; IDENT "y"])); - "simple token", (fun _ -> + "simple token", (fun _ -> Eq( Arith_lexer.lexeme (Lexing.from_string "10"), NUMERAL 10. ) ); - "number_lexer", (fun _ -> + "number_lexer", (fun _ -> let v = ref [] in let add t = v:= t :: !v in Number_lexer.token add (Lexing.from_string "32 + 32 ( ) * / "); @@ -54,7 +53,7 @@ let lexer_suites = "new line"; "/"; "new line"; - "eof"])); + "eof"])); "simple number", (fun _ -> Eq ( Arith_syntax.str ( @@ -70,7 +69,7 @@ let lexer_suites = ) ), "x+3.+4.+y")); - + ] diff --git a/jscomp/test/libarg_test.ml b/jscomp/test/libarg_test.ml index 36ad426c09..a190eb0c1c 100644 --- a/jscomp/test/libarg_test.ml +++ b/jscomp/test/libarg_test.ml @@ -3,7 +3,7 @@ let current = ref 0;; let accum = ref [];; let record fmt (* args *) = - Printf.kprintf (fun s -> accum := s :: !accum) fmt + Printf.ksprintf (fun s -> accum := s :: !accum) fmt ;; let f_unit () = record "unit()";; diff --git a/jscomp/test/map_test.ml b/jscomp/test/map_test.ml index 6c914a1437..7fca7d45f4 100644 --- a/jscomp/test/map_test.ml +++ b/jscomp/test/map_test.ml @@ -1,4 +1,3 @@ -open Mt module Int = struct type t = int let compare (x : int) (y : int) = Stdlib.compare x y diff --git a/jscomp/test/ppx_this_obj_field.ml b/jscomp/test/ppx_this_obj_field.ml index fb416f8f49..c65b8aaeaa 100644 --- a/jscomp/test/ppx_this_obj_field.ml +++ b/jscomp/test/ppx_this_obj_field.ml @@ -1,3 +1,5 @@ +[@@@ocaml.warning "-3"] + let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 let eq loc (x, y) = @@ -105,4 +107,3 @@ let () = let () = Mt.from_pair_suites __MODULE__ !suites - diff --git a/jscomp/test/qcc.ml b/jscomp/test/qcc.ml index 06bdf15fab..38212e53c3 100644 --- a/jscomp/test/qcc.ml +++ b/jscomp/test/qcc.ml @@ -321,7 +321,7 @@ and unary stk = then (Int, 1) else (Int, 5) | t when t = tokchar -> (Chr, 2) | _ -> failwith "[cast] expected" in - for k=1 to i + for _k=1 to i do ignore (next ()) done; unary stk; read ty diff --git a/jscomp/test/re_or_res/reasonReact.re b/jscomp/test/re_or_res/reasonReact.re index 9971afc846..0547e13aa0 100644 --- a/jscomp/test/re_or_res/reasonReact.re +++ b/jscomp/test/re_or_res/reasonReact.re @@ -161,7 +161,7 @@ let anyToUnit = _ => (); let anyToTrue = _ => true; -let willReceivePropsDefault = ({state}) => state; +let willReceivePropsDefault = ({state, _}) => state; let renderDefault = _self => string("RenderNotImplemented"); @@ -190,14 +190,13 @@ let convertPropsIfTheyreFromJs = (props, jsPropsToReason, debugName) => { let createClass = (type reasonState, type retainedProps, type action, debugName): reactClass => ReasonReactOptimizedCreateClass.createClass(. - [@u] - { + [@u] [@ocaml.warning "-27"] { /*** * TODO: Null out fields that aren't overridden beyond defaults in * `component`. React optimizes components that don't implement * lifecycles! */ - val displayName = debugName; + val displayName = debugName; val mutable subscriptions = Js.null; /*** * TODO: Avoid allocating this every time we need it. Should be doable. diff --git a/jscomp/test/re_or_res/recursive_react_component.re b/jscomp/test/re_or_res/recursive_react_component.re index 1d018f3904..9cc3705db6 100644 --- a/jscomp/test/re_or_res/recursive_react_component.re +++ b/jscomp/test/re_or_res/recursive_react_component.re @@ -1,4 +1,4 @@ -[@bs.config +[@mel.config { flags: [| "-dsource", diff --git a/jscomp/test/rec_value_test.ml b/jscomp/test/rec_value_test.ml index 52a8fa0e7c..d943b0f46a 100644 --- a/jscomp/test/rec_value_test.ml +++ b/jscomp/test/rec_value_test.ml @@ -80,7 +80,7 @@ let rec sum = (* else *) (* fun _-> print_endline "hey"; v () *) -let rec fake_v = 1::2::[] +let[@ocaml.warning "-39"] rec fake_v = 1::2::[] let rec fake_y = 2::3::[] and fake_z = 1::fake_y @@ -89,7 +89,7 @@ and fake_z = 1::fake_y let rec fake_z2 = 1::(sum 0 10) :: fake_y2 and fake_y2 = 2::3::[] -let rec v = 3 +let[@ocaml.warning "-39"] rec v = 3 type u = | B of string * (unit -> u) @@ -118,11 +118,11 @@ let rec y00 = C1 { hd = 1 ; tail = y00 } let xhd (h : h)= match h with - | C0 {hd} | C1 {hd} -> hd + | C0 {hd;_} | C1 {hd;_} -> hd let xtl (h : h)= match h with - | C0 {tail} | C1 {tail} -> tail + | C0 {tail;_} | C1 {tail;_} -> tail let suites = Mt.[ __LOC__, (fun _ -> diff --git a/jscomp/test/record_extension_test.ml b/jscomp/test/record_extension_test.ml index 03ab0d0c48..e6fe27d450 100644 --- a/jscomp/test/record_extension_test.ml +++ b/jscomp/test/record_extension_test.ml @@ -1,19 +1,18 @@ - (* for o in jscomp/test/*test.js ; do npx mocha $o ; done *) let suites : Mt.pair_suites ref = ref [] let test_id = ref 0 -let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y +let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y (* Record_extension *) type t0 = .. -type t0 += Inline_record of { x : int ; y : string} +type t0 += Inline_record of { x : int ; y : string} -let f x = - match x with - | Inline_record {x; y} -> Some (x + int_of_string y) - | _ -> None +let f x = + match x with + | Inline_record {x; y} -> Some (x + int_of_string y) + | _ -> None let v0 = Inline_record {x = 3; y = "4"} ;; eq __LOC__ (f v0) (Some 7) @@ -23,35 +22,34 @@ type t1 = | A of { x : int } [@ocaml.unboxed] (* Record_inlined *) -type t2 = - | B +type t2 = + | B | C of {x : int ;y : string } | D of { w : int} -let f2 x = - match x with +let f2 x = + match x with | D _ | B -> 0 - | C {x } -> x + | C {x; _ } -> x -let f2_with x = - match x with +let f2_with x = + match x with | D _ - | B -> x + | B -> x | C u -> C {u with x = 0} -exception A of {name : int; x : int} +exception A of {name : int; x : int} exception B of int * int exception C of {name : int } -let u f = +let u f = try f () with - | A {name ; x} -> name + x + | A {name ; x} -> name + x | B (a,b) -> a + b | C x -> x.name | _ -> -1 -let () = +let () = Mt.from_pair_suites __LOC__ !suites - diff --git a/jscomp/test/record_name_test.ml b/jscomp/test/record_name_test.ml index 5fe38501b5..0a0179e219 100644 --- a/jscomp/test/record_name_test.ml +++ b/jscomp/test/record_name_test.ml @@ -24,7 +24,7 @@ type t0 = { x: t0 ; y : int} let f1 u = match u with -| {x = { x = {x={y}}}} -> y +| {x = { x = {x={y;_};_};_};_} -> y type t1 = { mutable x' : int diff --git a/jscomp/test/scanf_io.ml b/jscomp/test/scanf_io.ml index 375d11a668..a54e7ff449 100644 --- a/jscomp/test/scanf_io.ml +++ b/jscomp/test/scanf_io.ml @@ -1,5 +1,4 @@ open Scanf -open Testing (* The tscanf testbed case file name. *) let tscanf_data_file = "tscanf_data";; diff --git a/jscomp/test/set_gen.ml b/jscomp/test/set_gen.ml index 93bfc617a3..eb2af6dc16 100644 --- a/jscomp/test/set_gen.ml +++ b/jscomp/test/set_gen.ml @@ -13,22 +13,22 @@ (** balanced tree based on stdlib distribution *) -type 'a t = - | Empty - | Node of 'a t * 'a * 'a t * int +type 'a t = + | Empty + | Node of 'a t * 'a * 'a t * int -type 'a enumeration = +type 'a enumeration = | End | More of 'a * 'a t * 'a enumeration -let rec cons_enum s e = - match s with - | Empty -> e +let rec cons_enum s e = + match s with + | Empty -> e | Node(l,v,r,_) -> cons_enum l (More(v,r,e)) -let rec height = function - | Empty -> 0 - | Node(_,_,_,h) -> h +let height = function + | Empty -> 0 + | Node(_,_,_,h) -> h (* Smallest and greatest element of a set *) @@ -50,11 +50,11 @@ let empty = Empty let is_empty = function Empty -> true | _ -> false let rec cardinal_aux acc = function - | Empty -> acc - | Node (l,_,r, _) -> - cardinal_aux (cardinal_aux (acc + 1) r ) l + | Empty -> acc + | Node (l,_,r, _) -> + cardinal_aux (cardinal_aux (acc + 1) r ) l -let cardinal s = cardinal_aux 0 s +let cardinal s = cardinal_aux 0 s let rec elements_aux accu = function | Empty -> accu @@ -83,137 +83,137 @@ let rec exists p = function | Node(l, v, r, _) -> p v || exists p l || exists p r -let max_int3 (a : int) b c = - if a >= b then - if a >= c then a +let max_int3 (a : int) b c = + if a >= b then + if a >= c then a else c - else + else if b >=c then b - else c -let max_int_2 (a : int) b = - if a >= b then a else b + else c +let max_int_2 (a : int) b = + if a >= b then a else b exception Height_invariant_broken -exception Height_diff_borken +exception Height_diff_borken -let rec check_height_and_diff = - function +let rec check_height_and_diff = + function | Empty -> 0 - | Node(l,_,r,h) -> + | Node(l,_,r,h) -> let hl = check_height_and_diff l in let hr = check_height_and_diff r in if h <> max_int_2 hl hr + 1 then raise Height_invariant_broken - else - let diff = (abs (hl - hr)) in - if diff > 2 then raise Height_diff_borken - else h + else + let diff = (abs (hl - hr)) in + if diff > 2 then raise Height_diff_borken + else h -let check tree = +let check tree = ignore (check_height_and_diff tree) -(* - Invariants: +(* + Invariants: 1. {[ l < v < r]} - 2. l and r balanced + 2. l and r balanced 3. [height l] - [height r] <= 2 *) -let create l v r = +let create l v r = let hl = match l with Empty -> 0 | Node (_,_,_,h) -> h in let hr = match r with Empty -> 0 | Node (_,_,_,h) -> h in - Node(l,v,r, if hl >= hr then hl + 1 else hr + 1) + Node(l,v,r, if hl >= hr then hl + 1 else hr + 1) (* Same as create, but performs one step of rebalancing if necessary. Invariants: 1. {[ l < v < r ]} - 2. l and r balanced + 2. l and r balanced 3. | height l - height r | <= 3. Proof by indunction - Lemma: the height of [bal l v r] will bounded by [max l r] + 1 + Lemma: the height of [bal l v r] will bounded by [max l r] + 1 *) (* let internal_bal l v r = match l with | Empty -> - begin match r with + begin match r with | Empty -> Node(Empty,v,Empty,1) - | Node(rl,rv,rr,hr) -> + | Node(rl,rv,rr,hr) -> if hr > 2 then begin match rl with - | Empty -> create (* create l v rl *) (Node (Empty,v,Empty,1)) rv rr - | Node(rll,rlv,rlr,hrl) -> - let hrr = height rr in - if hrr >= hrl then - Node + | Empty -> create (* create l v rl *) (Node (Empty,v,Empty,1)) rv rr + | Node(rll,rlv,rlr,hrl) -> + let hrr = height rr in + if hrr >= hrl then + Node ((Node (Empty,v,rl,hrl+1))(* create l v rl *), - rv, rr, if hrr = hrl then hrr + 2 else hrr + 1) - else - let hrll = height rll in - let hrlr = height rlr in + rv, rr, if hrr = hrl then hrr + 2 else hrr + 1) + else + let hrll = height rll in + let hrlr = height rlr in create - (Node(Empty,v,rll,hrll + 1)) - (* create l v rll *) - rlv + (Node(Empty,v,rll,hrll + 1)) + (* create l v rll *) + rlv (Node (rlr,rv,rr, if hrlr > hrr then hrlr + 1 else hrr + 1)) - (* create rlr rv rr *) - end - else Node (l,v,r, hr + 1) + (* create rlr rv rr *) + end + else Node (l,v,r, hr + 1) end | Node(ll,lv,lr,hl) -> - begin match r with + begin match r with | Empty -> - if hl > 2 then + if hl > 2 then (*if height ll >= height lr then create ll lv (create lr v r) else*) - begin match lr with - | Empty -> - create ll lv (Node (Empty,v,Empty, 1)) - (* create lr v r *) - | Node(lrl,lrv,lrr,hlr) -> - if height ll >= hlr then + begin match lr with + | Empty -> + create ll lv (Node (Empty,v,Empty, 1)) + (* create lr v r *) + | Node(lrl,lrv,lrr,hlr) -> + if height ll >= hlr then create ll lv - (Node(lr,v,Empty,hlr+1)) + (Node(lr,v,Empty,hlr+1)) (*create lr v r*) - else - let hlrr = height lrr in - create + else + let hlrr = height lrr in + create (create ll lv lrl) lrv - (Node(lrr,v,Empty,hlrr + 1)) + (Node(lrr,v,Empty,hlrr + 1)) (*create lrr v r*) - end - else Node(l,v,r, hl+1) + end + else Node(l,v,r, hl+1) | Node(rl,rv,rr,hr) -> - if hl > hr + 2 then - begin match lr with + if hl > hr + 2 then + begin match lr with | Empty -> create ll lv (create lr v r) | Node(lrl,lrv,lrr,_) -> if height ll >= height lr then create ll lv (create lr v r) - else + else create (create ll lv lrl) lrv (create lrr v r) - end + end else - if hr > hl + 2 then - begin match rl with + if hr > hl + 2 then + begin match rl with | Empty -> - let hrr = height rr in + let hrr = height rr in Node( (Node (l,v,Empty,hl + 1)) (*create l v rl*) , rv, rr, - if hrr > hr then hrr + 1 else hl + 2 + if hrr > hr then hrr + 1 else hl + 2 ) | Node(rll,rlv,rlr,_) -> - let hrr = height rr in - let hrl = height rl in - if hrr >= hrl then create (create l v rl) rv rr else + let hrr = height rr in + let hrl = height rl in + if hrr >= hrl then create (create l v rl) rv rr else create (create l v rll) rlv (create rlr rv rr) end - else + else Node(l,v,r, if hl >= hr then hl+1 else hr + 1) end *) @@ -223,11 +223,11 @@ let internal_bal l v r = if hl > hr + 2 then begin match l with Empty -> assert false - | Node(ll, lv, lr, _) -> + | Node(ll, lv, lr, _) -> if height ll >= height lr then - (* [ll] >~ [lr] - [ll] >~ [r] - [ll] ~~ [ lr ^ r] + (* [ll] >~ [lr] + [ll] >~ [r] + [ll] ~~ [ lr ^ r] *) create ll lv (create lr v r) else begin @@ -236,7 +236,7 @@ let internal_bal l v r = | Node(lrl, lrv, lrr, _)-> (* [lr] >~ [ll] [lr] >~ [r] - [ll ^ lrl] ~~ [lrr ^ r] + [ll ^ lrl] ~~ [lrr ^ r] *) create (create ll lv lrl) lrv (create lrr v r) end @@ -253,19 +253,19 @@ let internal_bal l v r = create (create l v rll) rlv (create rlr rv rr) end end else - Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) + Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) let rec remove_min_elt = function Empty -> invalid_arg "Set.remove_min_elt" | Node(Empty, v, r, _) -> r | Node(l, v, r, _) -> internal_bal (remove_min_elt l) v r -let singleton x = Node(Empty, x, Empty, 1) +let singleton x = Node(Empty, x, Empty, 1) -(* +(* All elements of l must precede the elements of r. Assume | height l - height r | <= 2. - weak form of [concat] + weak form of [concat] *) let internal_merge l r = @@ -291,10 +291,10 @@ let rec add_max_element v = function | Node (l, x, r, h) -> internal_bal l x (add_max_element v r) -(** +(** Invariants: - 1. l < v < r - 2. l and r are balanced + 1. l < v < r + 2. l and r are balanced Proof by induction The height of output will be ~~ (max (height l) (height r) + 2) @@ -305,19 +305,19 @@ let rec internal_join l v r = (Empty, _) -> add_min_element v r | (_, Empty) -> add_max_element v l | (Node(ll, lv, lr, lh), Node(rl, rv, rr, rh)) -> - if lh > rh + 2 then + if lh > rh + 2 then (* proof by induction: - now [height of ll] is [lh - 1] + now [height of ll] is [lh - 1] *) - internal_bal ll lv (internal_join lr v r) + internal_bal ll lv (internal_join lr v r) else - if rh > lh + 2 then internal_bal (internal_join l v rl) rv rr + if rh > lh + 2 then internal_bal (internal_join l v rl) rv rr else create l v r (* - Required Invariants: - [t1] < [t2] + Required Invariants: + [t1] < [t2] *) let internal_concat t1 t2 = match (t1, t2) with @@ -365,38 +365,38 @@ let of_sorted_list l = in fst (sub (List.length l) l) -let of_sorted_array l = +let of_sorted_array l = let rec sub start n l = - if n = 0 then Empty else - if n = 1 then + if n = 0 then Empty else + if n = 1 then let x0 = Array.unsafe_get l start in Node (Empty, x0, Empty, 1) - else if n = 2 then - let x0 = Array.unsafe_get l start in - let x1 = Array.unsafe_get l (start + 1) in + else if n = 2 then + let x0 = Array.unsafe_get l start in + let x1 = Array.unsafe_get l (start + 1) in Node (Node(Empty, x0, Empty, 1), x1, Empty, 2) else - if n = 3 then - let x0 = Array.unsafe_get l start in + if n = 3 then + let x0 = Array.unsafe_get l start in let x1 = Array.unsafe_get l (start + 1) in let x2 = Array.unsafe_get l (start + 2) in Node (Node(Empty, x0, Empty, 1), x1, Node(Empty, x2, Empty, 1), 2) - else + else let nl = n / 2 in let left = sub start nl l in - let mid = start + nl in - let v = Array.unsafe_get l mid in - let right = sub (mid + 1) (n - nl - 1) l in + let mid = start + nl in + let v = Array.unsafe_get l mid in + let right = sub (mid + 1) (n - nl - 1) l in create left v right in - sub 0 (Array.length l) l + sub 0 (Array.length l) l let is_ordered cmp tree = let rec is_ordered_min_max tree = match tree with | Empty -> `Empty - | Node(l,v,r,_) -> + | Node(l,v,r,_) -> begin match is_ordered_min_max l with - | `No -> `No + | `No -> `No | `Empty -> begin match is_ordered_min_max r with | `No -> `No @@ -410,22 +410,22 @@ let is_ordered cmp tree = | `V(min_v,max_v)-> begin match is_ordered_min_max r with | `No -> `No - | `Empty -> - if cmp max_v v < 0 then + | `Empty -> + if cmp max_v v < 0 then `V(min_v,v) else - `No + `No | `V(min_v_r, max_v_r) -> if cmp max_v min_v_r < 0 then `V(min_v,max_v_r) else `No end - end in - is_ordered_min_max tree <> `No + end in + is_ordered_min_max tree <> `No -let invariant cmp t = - check t ; - is_ordered cmp t +let invariant cmp t = + check t ; + is_ordered cmp t let rec compare_aux cmp e1 e2 = match (e1, e2) with @@ -443,7 +443,7 @@ let compare cmp s1 s2 = module type S = sig - type elt + type elt type t val empty: t val is_empty: t -> bool @@ -457,7 +457,7 @@ module type S = sig val min_elt: t -> elt val max_elt: t -> elt val choose: t -> elt - val of_sorted_list : elt list -> t + val of_sorted_list : elt list -> t val of_sorted_array : elt array -> t val partition: (elt -> bool) -> t -> t * t @@ -476,6 +476,6 @@ module type S = sig val find: elt -> t -> elt val of_list: elt list -> t val of_sorted_list : elt list -> t - val of_sorted_array : elt array -> t - val invariant : t -> bool -end + val of_sorted_array : elt array -> t + val invariant : t -> bool +end diff --git a/jscomp/test/stringmatch_test.ml b/jscomp/test/stringmatch_test.ml index c0bbbaae57..213db366f2 100644 --- a/jscomp/test/stringmatch_test.ml +++ b/jscomp/test/stringmatch_test.ml @@ -12,7 +12,7 @@ (* Empty string oddities *) -let rec tst01 s = match s with +let tst01 s = match s with | "" -> 0 | _ -> 1 diff --git a/jscomp/test/test_bug.ml b/jscomp/test/test_bug.ml index 62810da0f1..668b30dce6 100644 --- a/jscomp/test/test_bug.ml +++ b/jscomp/test/test_bug.ml @@ -1,6 +1,6 @@ external string_length : string -> int = "%string_length" external unsafe_blit_string : string -> int -> bytes -> int -> int -> unit - = "caml_blit_string" "noalloc" + = "caml_blit_string" [@@noalloc] external char_code: char -> int = "%identity" external char_chr: int -> char = "%identity" diff --git a/jscomp/test/test_filename.ml b/jscomp/test/test_filename.ml index 884302a732..4cdfca72ac 100644 --- a/jscomp/test/test_filename.ml +++ b/jscomp/test/test_filename.ml @@ -1,9 +1,6 @@ - - -open Filename +open Filename let v = chop_extension -let u = v -open List +let u = v let v = List.length diff --git a/jscomp/test/test_for_loop.ml b/jscomp/test/test_for_loop.ml index ad817e87a5..0dd008ca57 100644 --- a/jscomp/test/test_for_loop.ml +++ b/jscomp/test/test_for_loop.ml @@ -1,33 +1,30 @@ - - - -let for_ x = - for i = 0 to (print_endline "hi"; ignore 3; Array.length x) do +let for_ x = + for i = 0 to (print_endline "hi"; ignore 3; Array.length x) do print_endline x.(i) done -let for_2 x = - for i = 0 to Array.length x do +let for_2 x = + for i = 0 to Array.length x do print_endline x.(i) done -let for_3 x = +let for_3 x = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x do + for i = 0 to Array.length x do let j = i * 2 in arr.(i) <- (fun _ -> v := !v + j) done; Array.iter (fun x -> x ()) arr; !v - -let for_4 x = + +let for_4 x = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x do + for i = 0 to Array.length x do let j = i * 2 in let k = 2 * j in arr.(i) <- (fun _ -> v := !v + k) @@ -35,10 +32,10 @@ let for_4 x = Array.iter (fun x -> x ()) arr; !v -let for_5 x u = +let for_5 x u = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in - for i = 0 to Array.length x do + for i = 0 to Array.length x do let _j = i * 2 in let k = 2 * u * u in arr.(i) <- (fun _ -> v := !v + k) @@ -47,21 +44,21 @@ let for_5 x u = !v -let for_6 x u = +let for_6 x u = let v = ref 0 in let arr = Array.map (fun _ -> fun _ -> ()) x in let v4 = ref 0 in let v5 = ref 0 in - incr v4; - for j = 0 to 1 do - incr v5 ; + incr v4; + for _j = 0 to 1 do + incr v5 ; let v2 = ref 0 in let v3 = u in - for i = 0 to Array.length x do + for i = 0 to Array.length x do let _j = i * 2 in let k = 2 * u * u in let h = 2 * !v5 in - incr v2; + incr v2; arr.(i) <- (fun _ -> v := !v + k + !v2 + v3 + !v4 + !v5 + h) done; done; diff --git a/jscomp/test/test_internalOO.ml b/jscomp/test/test_internalOO.ml index 0e6d1285a9..9d7cfe70a0 100644 --- a/jscomp/test/test_internalOO.ml +++ b/jscomp/test/test_internalOO.ml @@ -15,7 +15,7 @@ open Obj (**** Object representation ****) -external set_id: 'a -> 'a = "caml_set_oo_id" "noalloc" +external set_id: 'a -> 'a = "caml_set_oo_id" [@@noalloc] (**** Object copy ****) @@ -395,7 +395,7 @@ let sendself obj lab = external sendcache : obj -> tag -> t -> int -> 'a = "%sendcache" external sendself : obj -> label -> 'a = "%sendself" external get_public_method : obj -> tag -> closure - = "caml_get_public_method" "noalloc" + = "caml_get_public_method" [@@noalloc] (**** table collection access ****) diff --git a/jscomp/test/test_per.ml b/jscomp/test/test_per.ml index 5260e2b744..dfb1da9d30 100644 --- a/jscomp/test/test_per.ml +++ b/jscomp/test/test_per.ml @@ -108,31 +108,53 @@ external ( +. ) : float -> float -> float = "%addfloat" external ( -. ) : float -> float -> float = "%subfloat" external ( *. ) : float -> float -> float = "%mulfloat" external ( /. ) : float -> float -> float = "%divfloat" -external ( ** ) : float -> float -> float = "caml_power_float" "pow" "float" -external exp : float -> float = "caml_exp_float" "exp" "float" -external expm1 : float -> float = "caml_expm1_float" "caml_expm1" "float" -external acos : float -> float = "caml_acos_float" "acos" "float" -external asin : float -> float = "caml_asin_float" "asin" "float" -external atan : float -> float = "caml_atan_float" "atan" "float" -external atan2 : float -> float -> float = "caml_atan2_float" "atan2" "float" +external ( ** ) : float -> float -> float = "caml_power_float" "pow" + [@@unboxed] [@@noalloc] +external exp : float -> float = "caml_exp_float" "exp" + [@@unboxed] [@@noalloc] +external expm1 : float -> float = "caml_expm1_float" "caml_expm1" + [@@unboxed] [@@noalloc] +external acos : float -> float = "caml_acos_float" "acos" + [@@unboxed] [@@noalloc] +external asin : float -> float = "caml_asin_float" "asin" + [@@unboxed] [@@noalloc] +external atan : float -> float = "caml_atan_float" "atan" + [@@unboxed] [@@noalloc] +external atan2 : float -> float -> float = "caml_atan2_float" "atan2" + [@@unboxed] [@@noalloc] external hypot : float -> float -> float - = "caml_hypot_float" "caml_hypot" "float" -external cos : float -> float = "caml_cos_float" "cos" "float" -external cosh : float -> float = "caml_cosh_float" "cosh" "float" -external log : float -> float = "caml_log_float" "log" "float" -external log10 : float -> float = "caml_log10_float" "log10" "float" -external log1p : float -> float = "caml_log1p_float" "caml_log1p" "float" -external sin : float -> float = "caml_sin_float" "sin" "float" -external sinh : float -> float = "caml_sinh_float" "sinh" "float" -external sqrt : float -> float = "caml_sqrt_float" "sqrt" "float" -external tan : float -> float = "caml_tan_float" "tan" "float" -external tanh : float -> float = "caml_tanh_float" "tanh" "float" -external ceil : float -> float = "caml_ceil_float" "ceil" "float" -external floor : float -> float = "caml_floor_float" "floor" "float" + = "caml_hypot_float" "caml_hypot" + [@@unboxed] [@@noalloc] +external cos : float -> float = "caml_cos_float" "cos" + [@@unboxed] [@@noalloc] +external cosh : float -> float = "caml_cosh_float" "cosh" + [@@unboxed] [@@noalloc] +external log : float -> float = "caml_log_float" "log" + [@@unboxed] [@@noalloc] +external log10 : float -> float = "caml_log10_float" "log10" + [@@unboxed] [@@noalloc] +external log1p : float -> float = "caml_log1p_float" "caml_log1p" + [@@unboxed] [@@noalloc] +external sin : float -> float = "caml_sin_float" "sin" + [@@unboxed] [@@noalloc] +external sinh : float -> float = "caml_sinh_float" "sinh" + [@@unboxed] [@@noalloc] +external sqrt : float -> float = "caml_sqrt_float" "sqrt" + [@@unboxed] [@@noalloc] +external tan : float -> float = "caml_tan_float" "tan" + [@@unboxed] [@@noalloc] +external tanh : float -> float = "caml_tanh_float" "tanh" + [@@unboxed] [@@noalloc] +external ceil : float -> float = "caml_ceil_float" "ceil" + [@@unboxed] [@@noalloc] +external floor : float -> float = "caml_floor_float" "floor" + [@@unboxed] [@@noalloc] external abs_float : float -> float = "%absfloat" external copysign : float -> float -> float - = "caml_copysign_float" "caml_copysign" "float" -external mod_float : float -> float -> float = "caml_fmod_float" "fmod" "float" + = "caml_copysign_float" "caml_copysign" + [@@unboxed] [@@noalloc] +external mod_float : float -> float -> float = "caml_fmod_float" "fmod" + [@@unboxed] [@@noalloc] external frexp : float -> float * int = "caml_frexp_float" external ldexp : float -> int -> float = "caml_ldexp_float" external modf : float -> float * float = "caml_modf_float" @@ -168,9 +190,9 @@ external string_length : string -> int = "%string_length" external bytes_length : bytes -> int = "%string_length" external bytes_create : int -> bytes = "caml_create_bytes" external string_blit : string -> int -> bytes -> int -> int -> unit - = "caml_blit_string" "noalloc" + = "caml_blit_string" [@@noalloc] external bytes_blit : bytes -> int -> bytes -> int -> int -> unit - = "caml_blit_string" "noalloc" + = "caml_blit_string" [@@noalloc] external bytes_unsafe_to_string : bytes -> string = "%identity" external bytes_unsafe_of_string : string -> bytes = "%identity" diff --git a/jscomp/test/test_primitive.ml b/jscomp/test/test_primitive.ml index 1414e39791..6eead34d5c 100644 --- a/jscomp/test/test_primitive.ml +++ b/jscomp/test/test_primitive.ml @@ -1,4 +1,3 @@ - (* include ( module X : sig val fib : int -> int end = struct let rec fib = function *) (* | 0 | 1 -> 1 *) (* | n -> fib (n - 1) + fib (n - 2) *) @@ -15,7 +14,7 @@ (* let leaf = Leaf *) (* let node l r = Node (l,r) *) -(* let f = Math.abs 3.0 +(* let f = Math.abs 3.0 Original definition at externs.zip//es3.js:888 var Math=require("Math"); *) @@ -50,7 +49,7 @@ type u = { } let xx = (0.,0.) let unboxed_x = {u=0.; v = 0.} -let f = fun {u;} -> u +let f = fun {u;_} -> u let gg x = x.u <-0. @@ -58,11 +57,11 @@ let f (x:string) = String.length x let is_lazy_force x = Lazy.force x -let rec fib (n:int) = - match n with - | 0 | 1 -> 1 - | n -> +let rec fib (n:int) = + match n with + | 0 | 1 -> 1 + | n -> let fib1 = fib(n-1) in let fib2 = fib(n-2) in let fib3 = 3 in - fib1 + fib2 + fib3 + fib1 + fib2 + fib3 diff --git a/jscomp/test/test_seq.ml b/jscomp/test/test_seq.ml index b90f9c53f9..610e65d2a2 100644 --- a/jscomp/test/test_seq.ml +++ b/jscomp/test/test_seq.ml @@ -46,7 +46,6 @@ type error = exception Stop of error;; (* used internally *) -open Printf let rec assoc3 x l = match l with diff --git a/jscomp/test/test_static_catch_ident.ml b/jscomp/test/test_static_catch_ident.ml index f2129f7240..c854757ce7 100644 --- a/jscomp/test/test_static_catch_ident.ml +++ b/jscomp/test/test_static_catch_ident.ml @@ -1,10 +1,8 @@ - - exception Scan_failure of string;; let scanf_bad_input ib = function | Scan_failure s | Failure s -> - for i = 0 to 100 do + for _i = 0 to 100 do print_endline s; (* necessary*) print_endline "don't inlinie" done diff --git a/jscomp/test/test_tuple.ml b/jscomp/test/test_tuple.ml index 9a4c19dd5c..de4e255bae 100644 --- a/jscomp/test/test_tuple.ml +++ b/jscomp/test/test_tuple.ml @@ -1,6 +1,6 @@ let () = let r = ref 0 in - for k = 1 to 10 do + for _k = 1 to 10 do for i = 1 to 10 do let (x, y) = if i mod 2 = 0 then (1, i * 2) @@ -9,4 +9,3 @@ let () = r := !r * x + y done; done; - diff --git a/jscomp/test/ticker.ml b/jscomp/test/ticker.ml index 534c7bb7ea..b06d3dd00b 100644 --- a/jscomp/test/ticker.ml +++ b/jscomp/test/ticker.ml @@ -63,7 +63,7 @@ let find_ticker_by_name all_tickers ticker = let print_all_composite all_tickers = List.iter (function | { type_ = Market; _ } -> () - | { type_ = Binary_op _; ticker_name; value; } -> (match value with + | { type_ = Binary_op _; ticker_name; value; _} -> (match value with | Some v -> (* Printf.printf "%s: %f\n" ticker_name v *) print_endline ticker_name | None -> (* Printf.printf "%s: nan\n" ticker_name *)print_endline ticker_name ) @@ -121,7 +121,7 @@ let compute_update_sequences all_tickers = match type_ with | Market -> Ticker_map.add ticker_name [ticker] map | _ -> ( - let rec loop up map ({ticker_name; type_; } as ticker) = + let rec loop up map ({ticker_name; type_; _} as ticker) = match type_ with | Market -> let l = Ticker_map.find ticker_name map in @@ -142,7 +142,7 @@ let compute_update_sequences all_tickers = Ticker_map.fold (fun k l map -> let l = List.sort_uniq (fun lhs rhs -> match lhs, rhs with - | {rank = Ranked x} , {rank = Ranked y} -> Stdlib.compare x y + | {rank = Ranked x;_} , {rank = Ranked y;_} -> Stdlib.compare x y | _ , _ -> failwith "All nodes should be ranked" ) l in Ticker_map.add k l map diff --git a/jscomp/test/topsort_test.ml b/jscomp/test/topsort_test.ml index de6b861d91..ddeecf33fb 100644 --- a/jscomp/test/topsort_test.ml +++ b/jscomp/test/topsort_test.ml @@ -15,61 +15,61 @@ let nexts (x : string) (g : graph) : string list = List.fold_left (fun acc (a,b) -> if a = x then b :: acc else acc) [] g let rec dfs1 nodes graph visited = - match nodes with - | [] -> List.rev visited - | x::xs -> - if List.mem x visited then dfs1 xs graph visited - else - begin - print_endline x ; - dfs1 (nexts x graph @ xs) graph (x::visited) + match nodes with + | [] -> List.rev visited + | x::xs -> + if List.mem x visited then dfs1 xs graph visited + else + begin + print_endline x ; + dfs1 (nexts x graph @ xs) graph (x::visited) end -let () = +let () = assert (dfs1 ["a"] graph [] = ["a"; "d"; "e"; "g"; "f"; "c"; "b"]) ; print_newline (); assert (dfs1 ["b"] (("f","d") :: graph) [] = ["b";"e"; "g"; "f"; "d"]) -let rec dfs2 nodes graph visited = - let rec aux nodes graph visited = - match nodes with - | [] -> visited - | x::xs -> +let dfs2 nodes graph visited = + let rec aux nodes graph visited = + match nodes with + | [] -> visited + | x::xs -> if List.mem x visited then aux xs graph visited - else + else aux xs graph (aux (nexts x graph) graph (x::visited )) in List.rev @@ aux nodes graph visited -let () = - let dfs1 = dfs2 in +let () = + let dfs1 = dfs2 in assert (dfs1 ["a"] graph [] = ["a"; "d"; "e"; "g"; "f"; "c"; "b"]); - assert (dfs1 ["b"] (("f","d") :: graph) [] = ["b";"e"; "g"; "f"; "d"]) + assert (dfs1 ["b"] (("f","d") :: graph) [] = ["b";"e"; "g"; "f"; "d"]) let dfs3 nodes graph = let visited = ref [] in - let rec aux node graph = - if not @@ List.mem node !visited then - begin + let rec aux node graph = + if not @@ List.mem node !visited then + begin visited := node :: !visited; List.iter (fun x -> aux x graph) (nexts node graph) - end in - List.iter (fun node -> + end in + List.iter (fun node -> aux node graph ) nodes ; List.rev (!visited) -let () = - let dfs1 = dfs3 in +let () = + let dfs1 = dfs3 in assert (dfs1 ["a"] graph = ["a"; "d"; "e"; "g"; "f"; "c"; "b"]); - assert (dfs1 ["b"] (("f","d") :: graph) = ["b";"e"; "g"; "f"; "d"]) + assert (dfs1 ["b"] (("f","d") :: graph) = ["b";"e"; "g"; "f"; "d"]) -(** since [x] is recorded before visiting its successors, so even with +(** since [x] is recorded before visiting its successors, so even with cycles, it is still terminating *) -let grwork = +let grwork = [ "wake","shower"; "shower", "dress"; @@ -77,84 +77,83 @@ let grwork = "wake", "eat"; "eat", "washup"; "washup", "go" - ] + ] -let unsafe_topsort graph = - let visited = ref [] in +let unsafe_topsort graph = + let visited = ref [] in let rec sort_nodes nodes = - List.iter (fun node -> - sort_node node - ) nodes - and sort_node node = - if not @@ List.mem node !visited + List.iter (fun node -> + sort_node node + ) nodes + and sort_node node = + if not @@ List.mem node !visited (* This check does not prevent cycle , - but it is still necessary? yes! + but it is still necessary? yes! since a node can have multiple parents *) - then - begin + then + begin sort_nodes (nexts node graph); - (* different from dfs, recorded after its + (* different from dfs, recorded after its successors have been searched for toplogoical sort, downside: can not detect cycles *) visited := node :: !visited; - end in + end in List.iter (fun (x,_) -> sort_node x ) graph; - !visited + !visited -;; +;; -let () = - assert - (unsafe_topsort grwork = +let () = + assert + (unsafe_topsort grwork = ["wake"; "shower"; "dress"; "eat";"washup";"go"] ) module String_set = Set.Make(String) -exception Cycle of string list -let pathsort graph = - let visited = ref [] in - let empty_path = String_set.empty, [] in - let (+>) node (set,stack) = - if String_set.mem node set then +exception Cycle of string list +let pathsort graph = + let visited = ref [] in + let empty_path = String_set.empty, [] in + let (+>) node (set,stack) = + if String_set.mem node set then raise (Cycle (node::stack)) - else + else String_set.add node set, node:: stack in - (*let check node (set,stack) = - if String_set.mem node set then + (*let check node (set,stack) = + if String_set.mem node set then raise (Cycle (node::stack)) in *) let rec sort_nodes path nodes = - List.iter (fun node -> - sort_node path node - ) nodes - and sort_node path node = - if not @@ List.mem node !visited then + List.iter (fun node -> + sort_node path node + ) nodes + and sort_node path node = + if not @@ List.mem node !visited then - begin + begin (* check node path ; *) sort_nodes ( node +> path )(nexts node graph); - (* different from dfs, recorded after its + (* different from dfs, recorded after its successors have been searched for toplogoical sort, downside: can not detect cycles *) visited := node :: !visited; - end in + end in List.iter (fun (x,_) -> sort_node empty_path x ) graph; - !visited + !visited ;; -let () = - assert (pathsort grwork = +let () = + assert (pathsort grwork = ["wake"; "shower"; "dress"; "eat";"washup";"go"]) -let () = - try +let () = + try ignore @@ pathsort (("go","eat")::grwork); assert false - with - | Cycle ["go";"washup";"eat";"go"] -> () + with + | Cycle ["go";"washup";"eat";"go"] -> () | _ -> assert false - diff --git a/jscomp/test/tscanf_test.ml b/jscomp/test/tscanf_test.ml index 9aa6eadd09..61f376922f 100644 --- a/jscomp/test/tscanf_test.ml +++ b/jscomp/test/tscanf_test.ml @@ -325,7 +325,7 @@ test __LOC__ (test13 ()) ;; (* A general int list scanner. *) -let rec scan_int_list ib = +let scan_int_list ib = bscanf ib "[ " (); let accu = scan_elems ib [] in bscanf ib " ]" (); @@ -346,7 +346,7 @@ let rec scan_elems ib accu = | c -> failwith "scan_elems") ;; -let rec scan_int_list ib = +let scan_int_list ib = bscanf ib "[ " (); scan_elems ib [] ;; @@ -522,7 +522,7 @@ let rec scan_elems ib accu = ;; (* The general int list scanner. *) -let rec scan_int_list ib = +let scan_int_list ib = bscanf ib "[ " (); let accu = scan_elems ib [] in bscanf ib " ]" (); diff --git a/jscomp/test/typeof_test.ml b/jscomp/test/typeof_test.ml index 733355ed5f..0ab760c5ba 100644 --- a/jscomp/test/typeof_test.ml +++ b/jscomp/test/typeof_test.ml @@ -1,4 +1,4 @@ -let string_or_number (type t) x = +let string_or_number x = let ty = Js.Types.classify x in match ty with | JSString v -> Js.log (v ^ "hei") ; true (* type check *) diff --git a/jscomp/test/unboxed_use_case.ml b/jscomp/test/unboxed_use_case.ml index e8dd31f61d..3b6c9c7387 100644 --- a/jscomp/test/unboxed_use_case.ml +++ b/jscomp/test/unboxed_use_case.ml @@ -1,5 +1,3 @@ - - type r = { f : 'a . ('a -> 'a ) } [@@unboxed] @@ -12,7 +10,7 @@ let u = { f = fun x -> x } let sample = map_pair u (3, true) -type _ para = C +type [@ocaml.warning "-37"] _ para = C type t = H : _ para -> t [@@unboxed] @@ -40,7 +38,7 @@ and ('a,'b) t3_aux = { let rec v0 : _ t3 = `A {field = v0 } -let rec v1 : _ t3 = `A {field = `B } +let v1 : _ t3 = `A {field = `B } (* module rec R: diff --git a/jscomp/test/uncurry_method.ml b/jscomp/test/uncurry_method.ml index 993adb5d08..f79d2c3f43 100644 --- a/jscomp/test/uncurry_method.ml +++ b/jscomp/test/uncurry_method.ml @@ -1,4 +1,3 @@ - let obj = object [@u] method hi a b = a + b method say a b = a - b @@ -51,7 +50,7 @@ end Js.t *) type add_meth = int -> int -> int [@meth] -let obj2 : < +let[@ocaml.warning "-61"] obj2 : < hi : add_meth; say : add_meth; xx : add_meth diff --git a/jscomp/test/unsafe_this.ml b/jscomp/test/unsafe_this.ml index 879bf6a26a..f599abadc4 100644 --- a/jscomp/test/unsafe_this.ml +++ b/jscomp/test/unsafe_this.ml @@ -24,7 +24,7 @@ let uux_this : < length : int > Js.t -> int -> int -> int [@mel.this] type (-'this, +'tuple) u -type 'a fn = (< > Js.t, 'a) u +(* type 'a fn = (< > Js.t, 'a) u *) (* doesn't typecheck: no subtype *) (*