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

Inconsistent namespacing when using modules in Main vs other modules #19048

Closed
jrevels opened this issue Oct 20, 2016 · 1 comment
Closed

Inconsistent namespacing when using modules in Main vs other modules #19048

jrevels opened this issue Oct 20, 2016 · 1 comment

Comments

@jrevels
Copy link
Member

jrevels commented Oct 20, 2016

This might be intentional, I'm not sure (please close if so):

julia> using BaseBenchmarks # BaseBenchmarks loads BenchmarkTools via `using`

julia> BenchmarkTools # BenchmarkTools is available in Main
BenchmarkTools

julia> module A 
           using BaseBenchmarks
           println(BenchmarkTools)
       end
ERROR: UndefVarError: BenchmarkTools not defined

Alternatively, with a fresh REPL:

julia> module A
           using BaseBenchmarks
       end
A

julia> BaseBenchmarks
BaseBenchmarks

I would expect an UnderVarError to be thrown in all cases. I guess the required packages' modules are all getting loaded into Main when the package is loaded, which is why they're all visible?

@yuyichao
Copy link
Contributor

Dup of #17997

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