SI-7128 copyToArray(xs, 0, 0) should not fail#4098
Conversation
|
Rebased on 2.12.x to avoid the hanging test. |
|
Are the two |
|
Arguably the error message has regressed a little, but that seemed like an intentional change. I'll defer to @Ichoran on that. |
|
I noticed recently that I urged a rich error message. But I defer to deference. Currently, |
|
@som-snytt - Good catch! The easiest fix would be to drop a |
|
Could we just revert this line change: https://github.com/scala/scala/pull/4098/files#diff-0f291618b38e49124a043fadd6fcd618L1153 ? |
|
@som-snytt @Ichoran I've shored up the overflow behaviour with a test, which passes after following @lrytz's suggestion. |
|
@Ichoran For future reference, you could have submitted a pull request to |
Fixed all copyToArray methods to do exactly what the docs say they do, with the least-suprise behavior of not throwing an exception if you ask to copy nothing (but would have copied out of range). Iterator had an undocumented requirement for the target index to be in range regardless if anything happened; this has been removed.
|
Ping @Ichoran for re-review. |
|
LGTM |
SI-7128 copyToArray(xs, 0, 0) should not fail
Fixed all copyToArray methods to do exactly what the docs say
they do, with the least-suprise behavior of not throwing an
exception if you ask to copy nothing (but would have copied
out of range).
Iterator had an undocumented requirement for the target index
to be in range regardless if anything happened; this has been
removed.