Skip to content

Commit

Permalink
fix "invalid assignment location" macro hygiene regression (JuliaLang…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 12, 2020
1 parent 9d41eb3 commit a83166a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
(cond ((atom? e) `(tuple ,e))
((eq? (car e) 'where) `(where ,(tuple-wrap-arrow-arglist (cadr e)) ,@(cddr e)))
((eq? (car e) 'tuple) e)
((eq? (car e) 'escape) `(escape ,(tuple-wrap-arrow-sig (cadr e))))
(else `(tuple ,e))))

(define (new-expansion-env-for x env (outermost #f))
Expand Down
5 changes: 5 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,11 @@ end
@test @m37134()(1) == 62
@test_throws MethodError @m37134()(1.0) == 62

macro n37134()
:($(esc(Expr(:tuple, Expr(:..., :x))))->$(esc(:x)))
end
@test @n37134()(2,1) === (2,1)

@testset "unary ± and ∓" begin
@test Meta.parse("±x") == Expr(:call, :±, :x)
@test Meta.parse("∓x") == Expr(:call, :, :x)
Expand Down

0 comments on commit a83166a

Please sign in to comment.