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
using Setfield
struct C{S,T}
i::Tend
c =C{Float64,Int}(1)
d =C{Float64, Int}(2)
Case 1:@set c.i =2#MethodError: no method matching C(::Int64)
Case 2:@set c.i, d.i = d.i, c.i #Doesn't fail but doesn't swap attributes either.
Case 3:@set! c.i, d.i = d.i, c.i #ERROR: setfield! immutable struct of type C cannot be changed
I feel Case 2 is a silent failure. Can someone please clarify this for me.
The text was updated successfully, but these errors were encountered:
Env:
julia = 1.6.1
Setfield = 0.7.1
MWE:
I feel Case 2 is a silent failure. Can someone please clarify this for me.
The text was updated successfully, but these errors were encountered: