Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@
,(expand-update-operator op op= (car e) rhs T))))
(else
(if (and (pair? lhs) (eq? op= '=)
(not (memq (car lhs) '(|.| tuple vcat ncat typed_hcat typed_vcat typed_ncat))))
(not (memq (car lhs) '(|.| globalref tuple vcat ncat typed_hcat typed_vcat typed_ncat))))
(error (string "invalid assignment location \"" (deparse lhs) "\"")))
(expand-update-operator- op op= lhs rhs declT))))

Expand Down
9 changes: 9 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,15 @@ end
@test ncalls_in_lowered(:((.+)(a, b .- (.^)(c, 2))), GlobalRef(Base, :BroadcastFunction)) == 0
end

module M59008 # dotop with global LHS in macro
using Test
global a = 1
macro counter()
:(a += 1)
end
@test @counter() === 2 === a
end

# issue #37656
@test :(if true 'a' else 1 end) == Expr(:if, true, quote 'a' end, quote 1 end)

Expand Down