File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -450,8 +450,7 @@ function est_to_dst(st::SyntaxTree)
450450 r3 -> @ast g st [K " ." rec (l) r3]
451451 end
452452 end
453- [K " inert" [K " Identifier" ]] -> @ast g st st[1 ]=> K " Symbol"
454- # [K"quote" [K"Identifier"]] -> @ast g st st[1]=>K"Symbol"
453+ ([K " inert" [K " Identifier" ]], when= ! hasattr (st[1 ], :mod )) -> @ast g st st[1 ]=> K " Symbol"
455454 [K " inert" _] -> st
456455 [K " inert_syntaxtree" _] -> st
457456 [K " module" _... ] -> st
Original file line number Diff line number Diff line change 881881 mac_st = JuliaLowering. expr_to_est (mac_ex, LineNumberNode (1 , " badfile" ))
882882 @test JuliaLowering. eval (test_mod, mac_st) == " none"
883883end
884+
885+ @testset " macro QuoteNode + inert behavior" begin
886+ Base. include_string (test_mod, raw """
887+ macro quoted_gr()
888+ QuoteNode(GlobalRef(Base, :dontresolveme))
889+ end
890+ """ )
891+ let gr = JuliaLowering. include_string (test_mod, " @quoted_gr" )
892+ @test gr. mod === Base
893+ @test gr. name === :dontresolveme
894+ end
895+ end
896+
897+ @testset " Base macros" begin
898+ jl_eval (test_mod,
899+ :(function test_invokelatest ()
900+ @eval invokelatest_target (x, y) = x + y
901+ out = @invokelatest (invokelatest_target (1 , 2 ))
902+ Base. delete_binding (@__MODULE__ , :invokelatest_target )
903+ out
904+ end ))
905+ # the following test needs to define this to be effective
906+ @test_throws UndefVarError JuliaLowering. include_string (test_mod, " invokelatest_target(1,2)" )
907+ @test JuliaLowering. include_string (test_mod, " test_invokelatest()" ) === 3
908+ end
You can’t perform that action at this time.
0 commit comments