Skip to content

Commit

Permalink
fix #11397
Browse files Browse the repository at this point in the history
the tupocalypse broke serialization of Tuple{}
  • Loading branch information
JeffBezanson committed May 28, 2015
1 parent 44cc8c2 commit 94d8164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let i = 2
:mul_float, :unbox, :box,
:eq_int, :slt_int, :sle_int, :ne_int,
:arrayset, :arrayref,
:Core, :Base, svec(), :reserved16,
:Core, :Base, svec(), Tuple{},
:reserved17, :reserved18, :reserved19, :reserved20,
false, true, nothing, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
Expand Down Expand Up @@ -555,11 +555,11 @@ function deserialize(s, ::Type{DataType})
mod = deserialize(s)::Module
ty = eval(mod,name)
if length(ty.parameters) == 0
params = svec()
t = ty
else
params = deserialize(s)
t = ty{params...}
end
t = ty{params...}
if form == 0
return t
end
Expand Down
3 changes: 3 additions & 0 deletions test/serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ create_serialization_stream() do s
lt = ntuple(len, i->0x1)
serialize(s, lt)

serialize(s, Tuple{})

seek(s, 0)
@test deserialize(s) === tpl
@test deserialize(s) === lt
@test deserialize(s) === Tuple{}
end

# Symbol
Expand Down

0 comments on commit 94d8164

Please sign in to comment.