What behavior do you want the non-initialized fields to have? Presumably to throw an error for any operation using them? Or do you want the non-initialized values to propagate and return other non-initialized values after operations?
This is the difference between nothing
and missing
in Julia. Since Julia aims to have both more “programming” and more “data science” uses, we don’t want to require a single default behavior for non-initialized values.
The Union{Nothing, Int64}
or Union{Missing, Int64}
is the correct solution to your problem, and it has the benefit of being explicit about the behavior of your uninitialized values.