If I have two dictionaries of some alternative type like OrderedDict
julia> using OrderedCollections
julia> a = OrderedDict("a"=>1, "b"=>"foo")
OrderedDict{String, Any} with 2 entries:
"a" => 1
"b" => "foo"
julia> b = OrderedDict("a"=>1, "c"=>"bar")
OrderedDict{String, Any} with 2 entries:
"a" => 1
"c" => "bar"
then merge()
will give me a result of the same type
julia> merge(a,b)
OrderedDict{String, Any} with 3 entries:
"a" => 1
"b" => "foo"
"c" => "bar"
However, if I use mergewith()
the result is always a Dict
julia> mergewith(*, a, b)
Dict{String, Any} with 3 entries:
"c" => "bar"
"b" => "foo"
"a" => 1
This seems inconsistent. I wanted and expected the result to be an OrderedDict
. Is this a bug?