Problem with using in Submodules

Yes, that’s right.

That’s the actual problem–you can’t do this. Here’s a simpler non-working example:

julia> module A
         module B
           using ..C
         end
         module C
           using ..B
         end
       end
ERROR: UndefVarError: C not defined

There must be a non-cyclic ordering of your various modules; they cannot depend on each other. If they both need to share some common information (such as a type definition), then you can move the shared information into a new module and have both modules depend on that shared module.

2 Likes