WARNING: both A and B export "func"; uses of it in module C must be qualified


julia> includet("test/algorithms/deterministic_behavioural_cloning.jl")
[ Info: Precompiling Aerobatics [3eaf170c-6d53-4308-86e7-def0ff749179]
WARNING: both BipartiteGraphs and Symbolics export "degree"; uses of it in module ModelingToolkit must be qualified

Is it a problem of ModelingToolkit in this case?

Yes, this is a problem for C to solve. To avoid the warning, import functions explicitly:

using A: func, TypeA
using B: TypeB

This is also considered a good code pattern for other reasons (it brings the answer to “from whence comes TypeA?” closer to anyone who reads your code).


Thanks a lot!

If you never use func, it doesn’t really matter. But the warning can be annoying, so I would do this anyway.

Or, just use import

import BipartiteGraphs
import Symbolics

(Or, one import and one using.)
With the imports, it’s even more explicit where things are defined.

If the package exports many objects and it’s near impossible to not use using (for example, plotting libraries), then it’s also possible to manually define which function you want to use:

using BipartiteGraphs
using Symbolics

degree = Symbolics.degree

It isn’t a problem per se. It’s a bit inherent to the way Julia allows developers to export functions. Alternatively, it would be needed to keep a log of who exports what or so. That would be very weird.