What are you trying to do exactly? Have a field which is identical among all instances of a type, or prevent modification of the field after the object has been constructed? If the latter, that’s not possible AFAIK (Julia considers that fields are private and that it’s your problem if you modify them when you are not supposed to). If the former, you can use a const global variable (local to the module in which it is defined).
However, what most people think this should do (at least without the const) is to assign a default value to the field, see https://github.com/JuliaLang/julia/issues/10146. And this is also planned to be implemented. As part of this the following is now reserved:
julia> mutable struct F3
a::Vector
c = [1, 1]
end
ERROR: syntax: "c=[1,1]" inside type definition is reserved