Skip to content

Commit ff7e014

Browse files
committed
adapt warn-error
1 parent f54875f commit ff7e014

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+691
-2021
lines changed

jscomp/others/belt_Array.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ external size: 'a array -> int = "%array_length"
1818
external getUnsafe: 'a array -> int -> 'a = "%array_unsafe_get"
1919
external setUnsafe: 'a array -> int -> 'a -> unit = "%array_unsafe_set"
2020
external getUndefined: 'a array -> int -> 'a Js.undefined = "%array_unsafe_get"
21-
external get: 'a array -> int -> 'a = "%array_safe_get"
21+
(* external get: 'a array -> int -> 'a = "%array_safe_get" *)
2222
let get arr i =
2323
if i >= 0 && i < length arr then Some (getUnsafe arr i) else None
2424
let getExn arr i =

jscomp/others/belt_HashMapInt.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ let isEmpty = C.isEmpty
189189

190190
let fromArray arr =
191191
let len = A.length arr in
192-
let v = make len in
192+
let v = make ~hintSize:len in
193193
for i = 0 to len - 1 do
194194
let k,value = (A.getUnsafe arr i) in
195195
set v k value

jscomp/others/belt_HashMapString.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ let isEmpty = C.isEmpty
189189

190190
let fromArray arr =
191191
let len = A.length arr in
192-
let v = make len in
192+
let v = make ~hintSize:len in
193193
for i = 0 to len - 1 do
194194
let k,value = (A.getUnsafe arr i) in
195195
set v k value

jscomp/others/belt_List.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,12 @@ let shuffle xs =
425425
A.shuffleInPlace v ;
426426
fromArray v
427427

428-
let rec fillAuxMap arr i x f =
428+
(* let rec fillAuxMap arr i x f =
429429
match x with
430430
| [] -> ()
431431
| h::t ->
432432
A.setUnsafe arr i (f h [@bs]) ;
433-
fillAuxMap arr (i + 1) t f
433+
fillAuxMap arr (i + 1) t f *)
434434

435435
(* module J = Js_json *)
436436
(* type json = J.t *)
@@ -679,7 +679,7 @@ let getAssoc xs x eq = getAssocU xs x (fun[@bs] a b -> eq a b)
679679
let rec hasAssocU xs x eq =
680680
match xs with
681681
| [] -> false
682-
| (a, b) :: l -> eq a x [@bs] || hasAssocU l x eq
682+
| (a, _) :: l -> eq a x [@bs] || hasAssocU l x eq
683683

684684
let hasAssoc xs x eq = hasAssocU xs x (fun[@bs] a b -> eq a b)
685685

@@ -795,7 +795,7 @@ let partitionU l p =
795795

796796
let partition l p = partitionU l (fun [@bs] x -> p x)
797797

798-
let rec unzip xs =
798+
let unzip xs =
799799
match xs with
800800
| [] -> ([], [])
801801
| (x,y)::l ->
@@ -805,7 +805,7 @@ let rec unzip xs =
805805
cellX, cellY
806806

807807

808-
let rec zip l1 l2 =
808+
let zip l1 l2 =
809809
match (l1, l2) with
810810
_, [] | [], _ -> []
811811
| (a1::l1, a2::l2) ->

jscomp/others/belt_MapDict.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ let rec splitAuxPivot n x pres ~cmp =
198198
if c < 0 then
199199
match N.toOpt l with
200200
| None ->
201-
N.(empty, return n)
201+
N.empty, N.return n
202202
| Some l ->
203203
let (ll,rl) = splitAuxPivot ~cmp l x pres in
204204
(ll, N.join rl v d r)
205205
else
206206
match N.toOpt r with
207207
| None ->
208-
N.(return n, empty)
208+
N.return n, N.empty
209209
| Some r ->
210210
let (lr, rr) = splitAuxPivot ~cmp r x pres in
211211
(N.join l v d lr, rr)
@@ -214,7 +214,7 @@ let rec splitAuxPivot n x pres ~cmp =
214214
let split n x ~cmp =
215215
match N.toOpt n with
216216
| None ->
217-
N.(empty, empty), None
217+
(N.empty, N.empty), None
218218
| Some n ->
219219
let pres = ref None in
220220
let v = splitAuxPivot ~cmp n x pres in

jscomp/others/belt_MapInt.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type 'a t = (key, 'a) N.t
1010

1111
let empty = N.empty
1212
let isEmpty = N.isEmpty
13-
let singleton = N.singleton
13+
(* let singleton = N.singleton *)
1414

1515
let minKey = N.minKey
1616
let minKeyUndefined = N.minKeyUndefined
@@ -152,7 +152,7 @@ let mergeMany h arr =
152152
done ;
153153
v.contents
154154

155-
let mergeArray = mergeMany
155+
(* let mergeArray = mergeMany *)
156156

157157
let has = I.has
158158
let cmpU = I.cmpU

jscomp/others/belt_MapInt.mli

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,7 @@ val getUndefined: 'v t -> key -> 'v Js.undefined
9090
val getWithDefault: 'v t -> key -> 'v -> 'v
9191

9292
val getExn: 'v t -> key -> 'v
93-
94-
val checkInvariantInternal: _ t -> unit
95-
(**
96-
{b raise} when invariant is not held
97-
*)
98-
93+
9994
val checkInvariantInternal: _ t -> unit
10095
(**
10196
{b raise} when invariant is not held

jscomp/others/belt_MapString.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type 'a t = (key, 'a) N.t
1010

1111
let empty = N.empty
1212
let isEmpty = N.isEmpty
13-
let singleton = N.singleton
13+
(* let singleton = N.singleton *)
1414

1515
let minKey = N.minKey
1616
let minKeyUndefined = N.minKeyUndefined
@@ -152,7 +152,7 @@ let mergeMany h arr =
152152
done ;
153153
v.contents
154154

155-
let mergeArray = mergeMany
155+
(* let mergeArray = mergeMany *)
156156

157157
let has = I.has
158158
let cmpU = I.cmpU

jscomp/others/belt_MapString.mli

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,7 @@ val getUndefined: 'v t -> key -> 'v Js.undefined
9090
val getWithDefault: 'v t -> key -> 'v -> 'v
9191

9292
val getExn: 'v t -> key -> 'v
93-
94-
val checkInvariantInternal: _ t -> unit
95-
(**
96-
{b raise} when invariant is not held
97-
*)
98-
93+
9994
val checkInvariantInternal: _ t -> unit
10095
(**
10196
{b raise} when invariant is not held

jscomp/others/belt_MutableMap.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ let keysToArray d =
180180
let valuesToArray d =
181181
N.valuesToArray (S.dataGet d)
182182

183-
let fromSortedArrayUnsafe (type key) (type identity) ~(id : (key,identity) id) xs : _ t =
183+
(* let fromSortedArrayUnsafe (type key) (type identity) ~(id : (key,identity) id) xs : _ t =
184184
let module M = (val id) in
185-
S.t ~data:(N.fromSortedArrayUnsafe xs) ~cmp:M.cmp
185+
S.t ~data:(N.fromSortedArrayUnsafe xs) ~cmp:M.cmp *)
186186

187187
let checkInvariantInternal d =
188188
N.checkInvariantInternal (S.dataGet d)

0 commit comments

Comments
 (0)