Am I missing something, or `sliceArray()` behaves ...
# announcements
m
Am I missing something, or
sliceArray()
behaves a bit weird when out-of-bounds range is passed? Example:
arrayOf("a", "b", "c").sliceArray(0 .. 3).forEach { println(it.toUpperCase()) }
k
Weird. Looks like
sliceArray
is using
copyofRange
which simply fills the extra indices with
null
. But I’d expect
sliceArray
itself to throw an exception if the bounds are exceeded. You should file an issue kotl.in/issue
i