Skip to content

Commit 9f2021a

Browse files
fix Dic bug
1 parent 622814a commit 9f2021a

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Manifest.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is machine-generated - editing it directly is not advised
2+

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)