This may be just an issue of wording: You say "index is out of range". 
By definition, Ruby arrays don't have a range. They can grow 
dynamically. In many cases, this is a big feature.

Also, you complain about inserting nil. So what about the following case:

a = [1, 2, 3]; a[3] = :foo; a # => [1, 2, 3, :foo]

There is no nil, so maybe this is okay. But the array is expanded. 
Should there be an error?

Regards,   Martin.

On 2013/03/27 10:51, sawa (Tsuyoshi Sawada) wrote:
>
> Issue #8172 has been reported by sawa (Tsuyoshi Sawada).
>
> ----------------------------------------
> Feature #8172: IndexError-returning counterparts to destructive Array methods
> https://bugs.ruby-lang.org/issues/8172