Using A: B does not put in scope exported B objects

For example:

julia> module A
           module B
               export f
               f(x) = 1
           end
       end
Main.A

julia> using .A: B

julia> f(1)
ERROR: UndefVarError: f not defined
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

Don’t you think that using .A: B should bring into scope the methods exported by B?

I think you want:

using .A.B

What you have now is only pulling in the name B.

5 Likes