JuliaIO / JLD2.jl

HDF5-compatible file format in pure Julia
Other
549 stars 85 forks source link

Loading BitSet gives error from saved file #410

Closed jzazo closed 2 years ago

jzazo commented 2 years ago

MWE:

using JLD2

b = BitSet(1:10)
save("bitset.jld2", "b", b)
load("bitset.jld2", "b")
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("bitset.jld2").

Fatal error:
ERROR: setfield!: const field .bits of type BitSet cannot be changed
(...)

Any idea how I can load these variables back? I have some old files that only error when loading the BitSet's. Thanks!

JonasIsensee commented 2 years ago

Hi @jzazo,

thank you for reporting this. I think, this is an issue introduced in julia v1.8 by julia adding immutable fields to mutable structs.

I'll have to figure out a general solution for that. Until then you're stuck with julia 1.7.