-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hi,
after upgrading to Julia 1.1.1 (from 1.1.0) the following code no longer works:
`using Setfield
struct Foo
a
b
end
nodes = [Foo(1,1), Foo(2,2)]
nodes_alt = @set nodes[1].a *= 0.9
`
It leads to the following stacktrace:
ERROR: LoadError: MethodError: no method matching setindex(::Array{Foo,1}, ::Foo, ::Int64) Closest candidates are: setindex(::Tuple, ::Any, ::Integer) at tuple.jl:31 Stacktrace: [1] set at /Users/jan/.julia/packages/Setfield/gMRkV/src/lens.jl:227 [inlined] [2] set(::Array{Foo,1}, ::Setfield.ComposedLens{Setfield.IndexLens{Tuple{Int64}},Setfield.PropertyLens{:a}}, ::Float64) at /Users/jan/.julia/packages/Setfield/gMRkV/src/lens.jl:216 [3] modify(::Setfield._UpdateOp{typeof(*),Float64}, ::Array{Foo,1}, ::Setfield.ComposedLens{Setfield.IndexLens{Tuple{Int64}},Setfield.PropertyLens{:a}}) at /Users/jan/.julia/packages/Setfield/gMRkV/src/lens.jl:87 [4] top-level scope at /Users/jan/.julia/packages/Setfield/gMRkV/src/sugar.jl:119 [5] include at ./boot.jl:326 [inlined] [6] include_relative(::Module, ::String) at ./loading.jl:1038 [7] include(::Module, ::String) at ./sysimg.jl:29 [8] include(::String) at ./client.jl:403 [9] top-level scope at none:0 in expression starting at /Users/jan/projects/julia/PowerDynamics.jl/setfields_error.jl:10