Keyword arguments not allowed on left-hand side of broadcast assignments?

Broadcasting with assignment works with a function call on the left-hand side. However, function calls with keyword arguments do not work for some reason:

julia> f(v; a = 0) = copy(v)
f (generic function with 1 method)

julia> f([1, 2, 3]) .*= 2
3-element Vector{Int64}:
 2
 4
 6

julia> f([1, 2, 3]; a = 1) .*= 2
ERROR: syntax: invalid syntax ; (thismodule).a = 1
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1

Is this a known issue? I don’t see why one form should be allowed and the other one not.

1 Like

(post deleted by author)

I agree that it seems like this should work. I haven’t seen the issue reported before, probably because using the syntax this way is a bit unusual.

(A similar error occurs with Julia 1.9.4, which uses the old Scheme parser, so the problem doesn’t seem specific to the new JuliaSyntax.jl. In fact, Meta.parse("f([1,2,3]; a=1) .*= 2") succeeds so it doesn’t seem to be a parser issue at all, but rather a problem in the lowering phase.)