Julia中可变结构的构造函数中的字典

Julia中可变结构的构造函数中的字典,julia,Julia,是否可以使用dict变量初始化可变结构。我正在尝试以下操作: mutable struct Global speciesCnt::Int64 chromosomeCnt::Int64 nodeCnt::Int64 innov_number::Int64 innovations::Dict{(Int64,Int64),Int64} cf::Config function Global(cf::Config) new(0,0,0

是否可以使用dict变量初始化可变结构。我正在尝试以下操作:

mutable struct Global
    speciesCnt::Int64
    chromosomeCnt::Int64
    nodeCnt::Int64
    innov_number::Int64
    innovations::Dict{(Int64,Int64),Int64}
    cf::Config
    function Global(cf::Config)
        new(0,0,0,0,Dict{(Int64,Int64),Int64}(),cf) # global dictionary
    end
end
但是,当我运行它时,会出现以下错误:

LoadError:TypeError:in-Type、in-parameter、expected-Type、Get-Tuple{DataType、DataType}

非常感谢您的帮助。
我使用的是Julia v 1.0

您的dict的正确类型签名是:

Dict{Tuple{Int64,Int64},Int64}
了解Julia中的类型签名的最简单方法是创建所需类型的对象,并使用
typeof
函数显示其类型:

julia> typeof(Dict((1,2)=>3))
Dict{Tuple{Int64,Int64},Int64}