You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the struct has non-atomic fields, a named args constructor is created but without the atomic field argument.
julia> Base.@kwdef mutable struct KWD
@atomic atom::Int
kk::String
end
KWD
julia> methods(KWD)
# 3 methods for type constructor:
[1] KWD(; kk) in Main at util.jl:478
[2] KWD(atom::Int64, kk::String) in Main at REPL[5]:2
[3] KWD(atom, kk) in Main at REPL[5]:2
When the struct has only atomic fields, no named args constructor is created
julia> Base.@kwdef mutable struct KWD2
@atomic atom::Int
end
julia> methods(KWD2)
# 2 methods for type constructor:
[1] KWD2(atom::Int64) in Main at REPL[1]:2
[2] KWD2(atom) in Main at REPL[1]:2
thanks
The text was updated successfully, but these errors were encountered:
When the struct has non-atomic fields, a named args constructor is created but without the atomic field argument.
When the struct has only atomic fields, no named args constructor is created
thanks
The text was updated successfully, but these errors were encountered: