I have a struct that includes a field of the same type, which I cannot assign at creation. Julia does not seem to like the following. (It coughs up a circular reference complaint.) I intend this to boil the problem down to its essentials
mutable struct Test
test:: Union{Test,Nothing}
end
t1 = Test(nothing)
t2 = Test(nothing)
t1.test = t2
t2.test = t1
- What is the right way to achieve this? (E.g., how can I point to my partner, who can point to me as his partner?)
- Separately, is the above currently the right way to have an initially "null" field?