On Sun, Apr 17, 2016 at 12:44 PM, STAR0SS <yu...@altern.org> wrote:
> I have something like that, except that the module B is inside an
> include("...")
>
>
> module A
>     type foo
>         x
>         foo(x) = new(x)
>     end
>     module B
>         import A.foo, Base.call
>         const y = foo(1)
>     end
> end
>
> I'm getting something like ERROR: LoadError: LoadError: ArgumentError: A not
> found in path

`import A.foo` look for the module at toplevel so this will fail if
`A` is in another module (it shouldn't if you just paste it into REPL)

The following should work even if A is in another module

julia> module K
       module A
           type foo
               x
               foo(x) = new(x)
           end
           module B
               import ..A.foo
               const y = foo(1)
           end
       end
       end
K



>
> I don't understand what's going on, someone can explain ?
>
> Thanks!
>

Reply via email to