JLD.jl icon indicating copy to clipboard operation
JLD.jl copied to clipboard

Saving array with #undef leads to UndefRefError

Open kalmarek opened this issue 7 years ago • 0 comments

While I see that title seems tautologic ;-) and that issue may very well be a feature, please consider the following example:

X = Array{Float64}(2,2)
X[1,1] = rand()
X[2,1] = rand()
X[2,2] = rand()
X = Symmetric(X, :L)
save("/tmp/mm.jld", "X", X)

Works well; However the same code with X=Array{BigFloat}(2,2) returns UndefRefError: access to undefined reference, because X[1,2] has not been initialized. Is it a bug or a feature?

(Yes, I know that symmetric X still carries the original X.data, but still...)

kalmarek avatar Jan 31 '18 22:01 kalmarek