Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global definitions not visible after includet #893

Open
serenity4 opened this issue Mar 4, 2025 · 1 comment
Open

Global definitions not visible after includet #893

serenity4 opened this issue Mar 4, 2025 · 1 comment

Comments

@serenity4
Copy link
Contributor

This fails in 1.11.3 and on nightly:

julia> module A

using Revise

includet("B.jl") # echo "module B end" > B.jl
using .B

end # module

ERROR: LoadError: UndefVarError: `B` not defined in `Main.A`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ ~/.julia/dev/Cthulhu/bug.jl:6
 [2] include(mapexpr::Function, mod::Module, _path::String)
   @ Base ./Base.jl:306
 [3] top-level scope
   @ REPL[1]:1
 [4] top-level scope
   @ REPL:1

whereas replacing includet by include works as intended:

julia> module A
       
       using Revise
       
       include("B.jl") # echo "module B end" > B.jl
       using .B
       
       end
Main.A

If includet is expected to behave differently than include, this should probably be mentioned in its docstring.

(not sure if this is an issue in Revise itself or one of its dependencies)

@pfitzseb
Copy link
Collaborator

pfitzseb commented Mar 4, 2025

If includet is expected to behave differently than include

I don't think it is, at least in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants