Skip to content

Commit 9d51d0d

Browse files
committed
fix #137
1 parent 34ad95d commit 9d51d0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/loadsave.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ for (applicable_, add_, dict_) in (
2121
(:applicable_loaders, :add_loader, :sym2loader),
2222
(:applicable_savers, :add_saver, :sym2saver))
2323
@eval begin
24-
$applicable_{sym}(::Union{Type{DataFormat{sym}}, Formatted{DataFormat{sym}}}) = get($dict_, sym, [:FileIO]) # if no loader is declared, fallback to FileIO
24+
function $applicable_{sym}(::Union{Type{DataFormat{sym}}, Formatted{DataFormat{sym}}})
25+
if haskey($dict_, sym)
26+
return $dict_[sym]
27+
end
28+
error("No $($applicable_) found for $(sym)")
29+
end
2530
function $add_{sym}(::Type{DataFormat{sym}}, pkg::Symbol)
2631
list = get($dict_, sym, Symbol[])
2732
$dict_[sym] = push!(list, pkg)

0 commit comments

Comments
 (0)