rescript-core
rescript-core copied to clipboard
:bug: - Fix binding of Array.get, to make sure it boxes options
trafficstars
This can cause runtime crashes when the individual members are options. When you are using Option.getExn after an Array.get to get the value if you know the array is in bounds, it will crash if the item in the array an option type and is None for the element. In normal cases you would use Array.getUnsafe for this, but in more complex scenarios this can happen. The types are actually incorrect and it can lead to crashes where you wouldn't expect it.
@jfrolich ping about @glennsl comment