Hi all,
I am initializing an Array of Arrays with undef. Why does it give me an UndefRefError when accessing it, whereas an Array with undef does not? Also, did some behavior change? I seem to remember initializing Array of Arrays before and never having a UndefRefError before.
a = Array{Int64}(undef, 10)
b = Array{Array{Int64}}(undef, 10)
a[1] # No error
b[1] # UndefRefError
PS: performance issues or best practices asides. It seems that using fill
to initialize Array of Arrays might be better, but I’m just wondering what’s happening in the above case.