diff --git a/src/data/custom_serialization.jl b/src/data/custom_serialization.jl index b49a5f92..fcb4de1d 100644 --- a/src/data/custom_serialization.jl +++ b/src/data/custom_serialization.jl @@ -2,7 +2,6 @@ # The default, write a type as itself writeas(T::Type) = T -writeas(::Type{Union{}}, slurp...) = (@assert isempty(slurp); Union{}) # wconvert and rconvert do type conversion before reading and writing, # respectively. These fall back to convert. @@ -66,4 +65,4 @@ function jlconvert(::ReadRepresentation{T,CustomSerialization{S,ODR}}, track_weakref!(f, header_offset, v) return v end -end +end \ No newline at end of file diff --git a/src/data/specialcased_types.jl b/src/data/specialcased_types.jl index 1a021272..5efcc4cc 100644 --- a/src/data/specialcased_types.jl +++ b/src/data/specialcased_types.jl @@ -246,7 +246,9 @@ rconvert(::Type{Core.SimpleVector}, x::Vector{Any}) = Core.svec(x...) ## Dicts -writeas(::Type{<:AbstractDict{K,V}}) where {K,V} = Vector{Pair{K,V}} +writeas(::Type{Dict{K,V}}) where {K,V} = Vector{Pair{K,V}} +writeas(::Type{IdDict{Any,Any}}) = Vector{Pair{Any,Any}} +writeas(::Type{Base.ImmutableDict{K,V}}) where {K,V} = Vector{Pair{K,V}} wconvert(::Type{Vector{Pair{K,V}}}, x::AbstractDict{K,V}) where {K,V} = collect(x) function rconvert(::Type{T}, x::Vector{Pair{K,V}}) where {T<:AbstractDict,K,V} d = T() @@ -284,4 +286,4 @@ function writeas(NT::Type{NTuple{N,T}}) where {N,T} end wconvert(::Type{Vector{T}}, x::NTuple{N,T}) where {N,T} = collect(x) -rconvert(::Type{NTuple{N,T}}, x::Vector{T}) where {N,T} = NTuple{N,T}(x) +rconvert(::Type{NTuple{N,T}}, x::Vector{T}) where {N,T} = NTuple{N,T}(x) \ No newline at end of file