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

Throws an error when saving a 0-dimensional array

Open tawheeler opened this issue 8 years ago • 0 comments

Saving a 0-dimensional array can cause an error:

JLD.save("file.jld", "name", Array(Int))
LoadError: MethodError: no method matching one(::Type{Any})
Closest candidates are:
  one(!Matched::Type{Measures.Length{:mm,Float64}}) at /home/tim/.julia/v0.5/Plots/src/layouts.jl:17
  one(!Matched::Type{Measures.Length{:pct,Float64}}) at /home/tim/.julia/v0.5/Plots/src/layouts.jl:35
  one(!Matched::BitArray{2}) at bitarray.jl:413
...

To provide some context; I accidentally ran into this when saving a variable that I reshaped. Dims happened to be empty, but var array still contained data.

dims = Int[]
var = reshape(var, (dims...))

tawheeler avatar Feb 06 '17 19:02 tawheeler