JuliaIO / BSON.jl

Other
158 stars 39 forks source link

try finding module from loaded modules #120

Closed chengchingwen closed 1 year ago

chengchingwen commented 1 year ago

Solve the issue mentioned in #119 without needed to change the saved format. This would try to treat the first name in resolve as module name and look up Base.loaded_modules. If anything matched, use the matched module as init for resolve

chengchingwen commented 1 year ago

The failed on nightly is unrelated to this patch. It also happened on BSON#master.

CarloLucibello commented 1 year ago

Nice! Can you add a test showing the module within module import?

CarloLucibello commented 1 year ago

This would have spared the need for https://github.com/FluxML/Flux.jl/pull/2205

chengchingwen commented 1 year ago

Should be ready to go. The new added test only pass with this patch.