Closed
Description
Consider:
julia> struct Foo
x
f
end
julia> f = Foo(1, 2)
Foo(1, 2)
we have:
julia> (; x, f) = f
2
but
julia> (; f, x) = f
ERROR: type Int64 has no field x
Stacktrace:
[1] getproperty(x::Int64, f::Symbol)
@ Base ./Base.jl:38
[2] top-level scope
@ REPL[6]:1
Also in the first case, the overall return is the new value of f
, but I believe it would be more consistent to return the old value of f. I think the syntax should work in phases, where it collects all the values into ssa values and only then applies the updates.