Kernel#Array only casts - Array#new allows you to pass expected size.

You are probably calling the wrong method by mistake here. `Kernel#Array` doesn't take a `size` keyword argument - that's `Array#new`. You think you're allocating an array with a pre-allocated storage size, but you're just allocating an array `[size]`.
I also wonder why we assign it to `size`. As far as I can see we're not using that variable afterwards. Can you remove it as well?