Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make T{typeof(f)}() loadable again #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,11 @@ end
function _julia_type(s::AbstractString)
typ = get(_typedict, s, UnconvertedType)
if typ == UnconvertedType
sp = parse(s, raise=false)
if (isa(sp, Expr) && (sp.head == :error || sp.head == :continue || sp.head == :incomplete))
sp = try
parse(s)
catch err
println("error parsing type string ", s)
eval(sp)
rethrow(err)
end
typ = julia_type(fixtypes(sp))
if typ != UnsupportedType
Expand Down
8 changes: 8 additions & 0 deletions test/jldtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,14 @@ f2()
@test loadmacrotestvar1 == ['a', 'b', 'c']
@test loadmacrotestvar2 == 1

mktempdir() do dir
cd(dir) do
JLD.save("_.jld", "_", Val{typeof(sin)}())
# should not throw an error
JLD.load("_.jld", "_")
end
end

# Test StackFrame by saving profile output
@profile eigvals(randn(3,3))
li, lidict = Profile.retrieve()
Expand Down