I want to define structs with a parent-child relationship:
struct Parent
children::Vector{Child}
end
struct Child
parent::Parent
end
When I try to execute these definitions, I get:
ERROR: UnDefVarError: Child not defined
The following code, however, runs fine:
try
struct Child
parent::Parent
end
catch
end
struct Parent
children::Vector{Child}
end
struct Child
parent::Parent
end
What is the right way to handle this? Can I somehow declare the types before I define them?