From adb7c7ef2e213a7da869b4bdc513de301aa2c29a Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 16 Jan 2020 04:22:35 -0500 Subject: [PATCH] mark `inbounds` and `loopinfo` as quoted during lowering (#34397) (cherry picked from commit a7cd97a293df20b0f05c5ad864556938d91dcdea) --- src/ast.scm | 3 ++- test/syntax.jl | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ast.scm b/src/ast.scm index 3ca6e652cd626..82c7cd5d38c0f 100644 --- a/src/ast.scm +++ b/src/ast.scm @@ -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))) diff --git a/test/syntax.jl b/test/syntax.jl index 0a2c44c5ef936..724b5c109d6a9 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -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