Skip to content

Commit

Permalink
mark inbounds and loopinfo as quoted during lowering (#34397)
Browse files Browse the repository at this point in the history
(cherry picked from commit a7cd97a)
  • Loading branch information
JeffBezanson authored and KristofferC committed Jan 21, 2020
1 parent fe8aeb8 commit adb7c7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ast.scm
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@

;; predicates and accessors

(define (quoted? e) (memq (car e) '(quote top core globalref outerref line break inert meta)))
(define (quoted? e)
(memq (car e) '(quote top core globalref outerref line break inert meta inbounds loopinfo)))
(define (quotify e) `',e)
(define (unquote e)
(if (and (pair? e) (memq (car e) '(quote inert)))
Expand Down
8 changes: 8 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1971,3 +1971,11 @@ end
# issue #33987
f33987(args::(Vararg{Any, N} where N); kwargs...) = args
@test f33987(1,2,3) === (1,2,3)

@test @eval let
(z,)->begin
$(Expr(:inbounds, true))
$(Expr(:inbounds, :pop))
end
pop = 1
end == 1

0 comments on commit adb7c7e

Please sign in to comment.