Skip to content

Commit efe5c53

Browse files
Merge pull request #86 from CarloLucibello/master
fix Dict bug
2 parents 622814a + 80138a0 commit efe5c53

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.jl.cov
22
*.jl.*.cov
33
*.jl.mem
4+
Manifest.toml
5+
test.bson

src/extensions.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
lower(x::Dict{Symbol}) = BSONDict(x)
2+
lower(x::BSONDict) = BSONDict(x)
23

34
# Basic Types
45

test.bson

-5.64 MB
Binary file not shown.

test/runtests.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
using BSON
22
using Test
33

4-
roundtrip_equal(x) = BSON.roundtrip(x) == x
4+
function roundtrip_equal(x)
5+
y = BSON.roundtrip(x)
6+
typeof(y) == typeof(x) && x == y
7+
end
8+
9+
# avoid hitting bug where
10+
# Dict{Symbol,T} -> Dict{Symbol,Any}
11+
function roundtrip_equal(x::Dict{Symbol})
12+
y = BSON.roundtrip(x)
13+
y isa Dict{Symbol} && y == x
14+
end
515

616
mutable struct Foo
717
x

0 commit comments

Comments
 (0)