-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
When trying write a storage module that would internally use JLD, I ran into the following weird behavior:
julia> using JLD
julia> save("d.jld", "d", Dict("a" => 1.0))
then restart Julia to clear the workspace so that JLD is no longer loaded and go
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> module Mod
using JLD
@show typeof(load("d.jld", "d"))
end
┌ Warning: type JLD.AssociativeWrapper{Core.String,Core.Float64,Base.Dict{Core.String,Core.Float64}} not present in workspace; reconstructing
└ @ JLD ~/.julia/packages/JLD/1BoSz/src/jld_types.jl:703
typeof(load("d.jld", "d")) = getfield(JLD, Symbol("##JLD.AssociativeWrapper{Core.String,Core.Float64,Base.Dict{Core.String,Core.Float64}}#363"))
Main.Mod
This can be fixed by just loading JLD in Main:
julia> using JLD
julia> module Mod
using JLD
@show typeof(load("d.jld", "d"))
end
WARNING: replacing module Mod.
typeof(load("d.jld", "d")) = Dict{String,Float64}
Main.Mod
This seems related to #216, but I lack the understanding to judge whether it's actually a duplicate.
jonbarkerlondon, BenjaminGalliot, oren-bm, 609751565, abmnmj and 2 more
Metadata
Metadata
Assignees
Labels
No labels