From 9f6e7b2c1dd264d0b389a008a3c5f2d1065569a9 Mon Sep 17 00:00:00 2001 From: Pablo Zubieta <8410335+pabloferz@users.noreply.github.com> Date: Fri, 9 Sep 2022 11:54:09 -0500 Subject: [PATCH] Add JET inference improvements (#41) --- src/Reexport.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Reexport.jl b/src/Reexport.jl index b690c61..58d17d8 100644 --- a/src/Reexport.jl +++ b/src/Reexport.jl @@ -14,7 +14,7 @@ function reexport(m::Module, ex::Expr) return Expr(:block, map(e -> reexport(m, e), ex.args)...) end - ex.head in (:module, :using, :import) || + ex.head::Symbol in (:module, :using, :import) || ex.head === :toplevel && all(e -> isa(e, Expr) && e.head === :using, ex.args) || error("@reexport: syntax error") @@ -24,7 +24,7 @@ function reexport(m::Module, ex::Expr) # @reexport {using, import} module Foo ... end modules = Any[ex.args[2]] ex = Expr(:toplevel, ex, :(using .$(ex.args[2]))) - elseif ex.head in (:using, :import) && ex.args[1].head == :(:) + elseif ex.head::Symbol in (:using, :import) && ex.args[1].head === :(:) # @reexport {using, import} Foo: bar, baz symbols = [e.args[end] for e in ex.args[1].args[2:end]] return Expr(:toplevel, ex, :($eval($m, Expr(:export, $symbols...))))