Infiltrator.jl
Infiltrator.jl copied to clipboard
Cannot access names imported as `using Foo: bar as baz`
Julia supports the syntax using Foo: bar as baz. When importing names in this way, however, they are not accessible from within the infiltrator REPL.
MWE:
using Infiltrator
module Foo
function bar()
println("asdf")
end
end
using .Foo: bar as baz
function main()
Infiltrator.@infiltrate
end
Output:
julia> main()
Infiltrating (on thread 1) main()
at REPL[12]:2
infil> baz
ERROR: UndefVarError: `baz` not defined
This is https://github.com/JuliaLang/julia/issues/36529.
I'm handling the using .Foo: bar case myself here by also checking the Foo binding, but that's not possible for bar as baz.
On the latest master you can use names(...; usings=true) to fix this issue.