rescript-core icon indicating copy to clipboard operation
rescript-core copied to clipboard

`Array.getUnsafe` does not throw `Not_found` if index doesn't exist in array

Open dsiu opened this issue 2 years ago • 1 comments

According to Core__Array.resi, Array.getUnsafe should throw Not_found if the index is out of bounds. However, this is not the case; it returns undefined instead.

ReScript Playground Link

https://github.com/rescript-association/rescript-core/blob/d5904bd82ce2fe77ad66619e66ae5ef935eb115f/src/Core__Array.resi#L811-L830

dsiu avatar Dec 30 '23 07:12 dsiu

Fixed by https://github.com/rescript-association/rescript-core/pull/168

DZakh avatar Dec 31 '23 09:12 DZakh