Skip to content

Commit 4d60693

Browse files
committed
Mention Array.slice instead of Array.sub and Belt.Array.slice in array spread error
1 parent 34ebfe0 commit 4d60693

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/syntax/src/res_core.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ module ErrorMessages = struct
7474
Explanation: such spread would create a subarray; out of performance \
7575
concern, our pattern matching currently guarantees to never create new \
7676
intermediate data.\n\
77-
Solution: if it's to validate the first few elements, use a `when` clause \
78-
+ Array size check + `get` checks on the current pattern. If it's to \
79-
obtain a subarray, use `Array.sub` or `Belt.Array.slice`."
77+
Solution: if it's to validate the first few elements, use an `if` clause \
78+
+ Array length check + `get` checks on the current pattern. If it's to \
79+
obtain a subarray, use `Array.slice`."
8080

8181
let record_expr_spread =
8282
"Records can only have one `...` spread, at the beginning.\n\

0 commit comments

Comments
 (0)