I think you’re confusing the 2 in an Array parameter set with the number of items, when it’s the number of dimensions. I’m pretty sure you’re creating a Vector, not a Matrix.
You also probably want to work with UTF8String, not String. — John On Mar 23, 2014, at 6:51 PM, Collin Glass <collinglas...@gmail.com> wrote: > I'm trying to make a constructor for a custom type in Julia: > > type Cell > Base::Dict{String, String} > zLayers::Array{Dict{String, String},2} > X::Int > Y::Int > > Cell() = new(Dict{String,String}(),[Dict{String, String}(),Dict{String, > String}()],0,0) > end > > try > gamestate = Cell() > catch err > print("connection ended with error $err\n") > end > Throws error: > > connection ended with error > MethodError(convert,(Array{Dict{String,String},2},[Dict{String,String}(),Dict{String,String}()])) > So how do we do proper initialization for Arrays of Dictionaries? >