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

Saving tuple-like types of unknown size

Open Cornelius-G opened this issue 3 years ago • 1 comments

Hi,

should it be possible to save tuple-like types of unknown size?

Currently, this is not working:

using JLD2

T = NTuple{N, Int} where N
jldsave("test.jld2", myT = T)

but giving the following stacktrace.txt

Interestingly, this way it works:

struct test_workaround
    a::(NTuple{N,Int} where N)
end

jldsave("test.jld2", a=test_workaround)

while this is again giving the same error:

struct test{X<:(NTuple{N,Int} where N)}
    a::X
end
jldsave("test.jld2", a=test)

(This issue is closely related to https://github.com/oschulz/ValueShapes.jl/issues/62)

Cornelius-G avatar Jun 20 '22 13:06 Cornelius-G

You are right, that should probably be possible.

JonasIsensee avatar Jun 20 '22 13:06 JonasIsensee