Open marius311 opened 4 years ago
I think this is a more general problem with macros being expanded before the package is loaded, I've run into it when e.g. calling Zygote.@adjoint
within a block. Moving the code into a file is a work-around:
julia> using Requires
shell> cat test.jl
x = 2
@eval $x
julia> @require Requires="ae029012-a4dd-5104-9daa-d747884805df" begin
include("test.jl")
end
2
julia> @require Requires="ae029012-a4dd-5104-9daa-d747884805df" begin
x = 2
@eval $x
end
ERROR: UndefVarError: x not defined
A MWE with Julia 1.4.2 and Requires v1.0.1: