Skip to content

Commit

Permalink
fix #27155, macro hygiene of A{B} = C expressions (#27210)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored May 23, 2018
1 parent baa1437 commit ca35cd9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
;; where
(pattern-lambda (where ex . vars)
(cons 'varlist (typevar-names vars)))
(pattern-lambda (= (curly ex . vars) rhs)
(cons 'varlist (typevar-names vars)))

;; let
(pattern-lambda (let binds ex)
Expand Down
9 changes: 9 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1448,3 +1448,12 @@ end
@test Meta.lower(@__MODULE__, :(Int[ return 0 for i=1:2 ])) == Expr(:error, "\"return\" not allowed inside comprehension or generator")
@test [ ()->return 42 for i = 1:1 ][1]() == 42
@test Function[ identity() do x; return 2x; end for i = 1:1 ][1](21) == 42

# issue #27155
macro test27155()
quote
MyTest27155{Arg} = Tuple{Arg}
MyTest27155
end
end
@test @test27155() == (Tuple{T} where T)

0 comments on commit ca35cd9

Please sign in to comment.