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

**URL:** <https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [July 10, 2021, 8:36am UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402 "2021-07-10T08:36:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [July 10, 2021, 8:36am UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402/1 "2021-07-10T08:36:50Z")

</div>

TL; DR)

```julia
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?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 10, 2021, 8:53am UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402/2 "2021-07-10T08:53:01Z")

</div>

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

```julia
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).

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [July 10, 2021, 8:54am UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402/3 "2021-07-10T08:54:34Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 10, 2021, 8:55am UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402/4 "2021-07-10T08:55:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [July 11, 2021, 8:12pm UTC](https://discourse.julialang.org/t/warning-both-a-and-b-export-func-uses-of-it-in-module-c-must-be-qualified/64402/5 "2021-07-11T20:12:19Z")

</div>

Or, just use import

```julia
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:

```julia
using BipartiteGraphs
using Symbolics

degree = Symbolics.degree

```

> [@iHany](#):
>
> Is it a problem of `ModelingToolkit` in this case?

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.
