Pairs are driving me a little bit crazy here. I don’t really understand the difference between a Dictionary and a Pair, and I don’t mentally see how a Dictionary type is inadequate. See this example. I’m trying to create a second Dictionary within the first dictionary, but I am somehow creating a Pair even though I am using the exact same syntax to create a Dictionary. Please help. What am I doing wrong?
julia> orderList = Dict{Int,Dict{Int,Int}}()
Dict{Int64,Dict{Int64,Int64}} with 0 entries
julia> push!(orderList, 2222201 => Dict())
Dict{Int64,Dict{Int64,Int64}} with 1 entry:
2222201 => Dict{Int64,Int64}()
julia> orderList[2222201] = 1 => 22222
ERROR: MethodError: Cannot `convert` an object of type Pair{Int64,Int64} to an object of type Dict{Int64,Int64}
Closest candidates are:
convert(::Type{T<:AbstractDict}, ::T<:AbstractDict) where T<:AbstractDict at abstractdict.jl:487
convert(::Type{T<:AbstractDict}, ::AbstractDict) where T<:AbstractDict at abstractdict.jl:490
convert(::Type{S}, ::T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where
T} where R)) where {S, T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where
T} where R)} at C:\Users\dburch.CSWG\.juliapro\JuliaPro_v1.0.4.1\packages\CategoricalArrays\JFETm\src\value.jl:91
...
Stacktrace:
[1] setindex!(::Dict{Int64,Dict{Int64,Int64}}, ::Pair{Int64,Int64}, ::Int64) at .\dict.jl:381
[2] top-level scope at none:0