From 826c891119b10dbb6c7da4f5a93b7ef9f48de8a5 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 11 Sep 2020 15:26:03 -0400 Subject: [PATCH] fix "invalid assignment location" macro hygiene regression --- src/macroexpand.scm | 1 + test/syntax.jl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/macroexpand.scm b/src/macroexpand.scm index e66ac41b92bc1..e6c4fde732611 100644 --- a/src/macroexpand.scm +++ b/src/macroexpand.scm @@ -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)) diff --git a/test/syntax.jl b/test/syntax.jl index 451d83a292ef3..5d2b4642f2eaa 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -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)