You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expand should not be walking through the body of modules, since it ends up expanding in the wrong scope:
julia>expand(quotemodule A
__init__() =2endend)
:(begin# none, line 2:returnmodule A
$(Expr(:method, :eval, :((top(svec))((top(apply_type))(Tuple,Any),(top(svec))())), AST(:($(Expr(:lambda, Any[:x], Any[Any[Any[:x,:Any,0]],Any[],0,Any[]], :(begin# none, line 2:
((top(getfield))(top(Core),:eval))(A,x)
end))))), false))
$(Expr(:method, :eval, :((top(svec))((top(apply_type))(Tuple,Any,Any),(top(svec))())), AST(:($(Expr(:lambda, Any[:m,:x], Any[Any[Any[:m,:Any,0],Any[:x,:Any,0]],Any[],0,Any[]], :(begin# none, line 2:
((top(getfield))(top(Core),:eval))(m,x)
end))))), false)) # line 3:$(Expr(:method, :__init__, :((top(svec))((top(apply_type))(Tuple),(top(svec))())), AST(:($(Expr(:lambda, Any[], Any[Any[],Any[],0,Any[]], :(begin# none, line 3:end))))), false))
endend)
it does the right thing when the module is quoted differently:
julia>expand(:(
module A
__init__() =2end
))
:(module A
eval(x) =begin# none, line 2:top(Core).eval(A,x)
endeval(m,x) =begin# none, line 2:top(Core).eval(m,x)
end# line 3:__init__() =begin# none, line 3:2endend)
The text was updated successfully, but these errors were encountered:
vtjnash
added
the
bug
Indicates an unexpected problem or unintended behavior
label
Jul 8, 2015
julia> eval(Main,quote
module A
import Base.Test.@test
@test true
end
end)
ERROR: UndefVarError: @test not defined
julia> eval(Main,:(
module A
import Base.Test.@test
@test true
end
))
A
expand should not be walking through the body of modules, since it ends up expanding in the wrong scope:
it does the right thing when the module is quoted differently:
The text was updated successfully, but these errors were encountered: