diff --git a/src/parameter_indexing.jl b/src/parameter_indexing.jl index 79336a31..3e83c5b5 100644 --- a/src/parameter_indexing.jl +++ b/src/parameter_indexing.jl @@ -204,7 +204,7 @@ struct MultipleSetters{S} <: AbstractSetIndexer end function (ms::MultipleSetters)(prob, val) - map((s!, v) -> s!(prob, v), ms.setters, val) + broadcast((s!, v) -> s!(prob, v), ms.setters, val) end for (t1, t2) in [ diff --git a/test/parameter_indexing_test.jl b/test/parameter_indexing_test.jl index 42dd9500..75a23537 100644 --- a/test/parameter_indexing_test.jl +++ b/test/parameter_indexing_test.jl @@ -35,7 +35,8 @@ for pType in [Vector, Tuple] ([1, [:b, :c]], [p[1], p[2:3]], [new_p[1], new_p[2:3]], false), ([1, (:b, :c)], [p[1], (p[2], p[3])], [new_p[1], (new_p[2], new_p[3])], false), ((1, [:b, :c]), (p[1], p[2:3]), (new_p[1], new_p[2:3]), true), - ((1, (:b, :c)), (p[1], (p[2], p[3])), (new_p[1], (new_p[2], new_p[3])), true) + ((1, (:b, :c)), (p[1], (p[2], p[3])), (new_p[1], (new_p[2], new_p[3])), true), + ([:a, :b], p[1:2], 42, true), ] get = getp(sys, sym) set! = setp(sys, sym) @@ -58,13 +59,13 @@ for pType in [Vector, Tuple] end @test fi.counter[] == 1 - @test get(fi) == newval + @test all(get(fi) .== newval) set!(fi, oldval) @test get(fi) == oldval @test fi.counter[] == 2 fi.ps[sym] = newval - @test get(fi) == newval + @test all(get(fi) .== newval) @test fi.counter[] == 3 fi.ps[sym] = oldval @test get(fi) == oldval @@ -79,7 +80,7 @@ for pType in [Vector, Tuple] else set!(p, newval) end - @test get(p) == newval + @test all(get(p) .== newval) set!(p, oldval) @test get(p) == oldval @test fi.counter[] == 4