Closed eschnett closed 1 year ago
I am reproducing this error too.
This should be fixable relatively easily.
Internals of the julia DataType
have changed a few times in recent releases.
1) find PR to base julia to figure out what changed
2) replace all code patters T.size
in JLD2 with a version-dependent accessor function
For reference: #331
Appears to be because of https://github.com/JuliaLang/julia/pull/47170
but replacing with Core.sizeof
doesn't do the trick since:
julia> Core.sizeof(Matrix{Float64})
ERROR: Type Array does not have a definite size.
Stacktrace:
[1] top-level scope
@ REPL[13]:1
julia> Matrix{Float64}.size
0
I think we need this function:
# Modelled after Base.datatype_alignment
function datatype_size(dt::DataType)
Base.@_foldable_meta
dt.layout == C_NULL && throw(UndefRefError())
size = unsafe_load(convert(Ptr{Base.DataTypeLayout}, dt.layout)).size
return Int(size)
end
PR in progress.
The current master version of JLD2 fails on the current master version of Julia: