Original bug ID: 7820 Reporter: thierry.martinez Status: resolved (set by @xavierleroy on 2018-07-11T17:17:49Z) Resolution: fixed Priority: normal Severity: minor Version: 4.07.0 Fixed in version: 4.07.1+dev/rc1 Category: standard library
Bug description
With OCaml 4.07.0 and trunk, we have
Array.of_seq (Array.to_seq [| 1; 2; 3 |]);;
: int array = [|3; 1; 2|]
In stdlib/array.ml, line 337 (last line of of_rev_list), we have
fill (len-1) tl
whereas it should be
fill (len-2) tl
since hd, which should be assigned to the cell (len - 1), is skipped.
Steps to reproduce
Run the top-level and execute the following line
Array.of_seq (Array.to_seq [| 1; 2; 3 |]);;
The text was updated successfully, but these errors were encountered:
Now might be time to repeat my proposition to ask for unit tests for new stdlib functions. In my Batteries experience, this helps a lot for development (quickcheck-style tests help even more).
Adding more test was actually discussed on #1002 , but left as future work. Perhaps I should have been stricter and waited for those tests before merging.
Original bug ID: 7820
Reporter: thierry.martinez
Status: resolved (set by @xavierleroy on 2018-07-11T17:17:49Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.07.0
Fixed in version: 4.07.1+dev/rc1
Category: standard library
Bug description
With OCaml 4.07.0 and trunk, we have
Array.of_seq (Array.to_seq [| 1; 2; 3 |]);;
In stdlib/array.ml, line 337 (last line of of_rev_list), we have
fill (len-1) tl
whereas it should be
fill (len-2) tl
since hd, which should be assigned to the cell (len - 1), is skipped.
Steps to reproduce
Run the top-level and execute the following line
Array.of_seq (Array.to_seq [| 1; 2; 3 |]);;
The text was updated successfully, but these errors were encountered: