I am trying to define a tree node as a mutable struct
in Julia v1.0, But I get the error
syntax: too few type parameters specified in "new{...}"
below is the MWE. Google points me to this https://github.com/JuliaLang/julia/issues/11310, but the content is quite cryptic, so how do I fix this error? I have a feeling that it has something to with T <: Real
but I don’t how to fix.
module JLBoostTrees
mutable struct JLBoostTreeNode{T <: Real}
weight::T
children::Vector{JLBoostTreeNode}
JLBoostTreeNode(w) = new(w, JLBoostTreeNode[])
end
end
I am doing this on JuliaBox and I don’t have access to v0.7 at work, and I think there might others with the same question, so posting here for the benefit of all.