FTR (for people other than Mason), an alternative technique, based on documented inner constructor behavior, for accomplishing the same task is demonstrated here:
It’s probably worth noting that, although potentially useful, these techniques may also be dangerous, because they bypass inner constructors. Example:
julia> struct InstancesDisallowed
InstancesDisallowed() = error("no can do")
end
julia> InstancesDisallowed.instance
InstancesDisallowed()
julia> InstancesDisallowed()
ERROR: no can do
I think that a type’s inner constructor being bypassable is something that could hypothetically turn out to be unpleasantly surprising for someone in some situation.