# Function name conflict: ADL / function merging?

**URL:** <https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335>\
**Category:** Internals & Design\
**Tags:** proposal, namespaces\
**Created:** [April 14, 2018, 5:16pm UTC](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335 "2018-04-14T17:16:17Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [April 15, 2018, 6:15pm UTC](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335/24 "2018-04-15T18:15:51Z")

</div>

Another option for this particular case:

```julia
module A
export foo, AA
struct AA end
foo(::AA) = :A
end

module B
export foo, BB
struct BB end
foo(::BB) = :B
end

module C
import A, B
import A: AA
import B: BB
foo(x::AA) = A.foo(x)
foo(x::BB) = B.foo(x)

@show foo(AA())
@show foo(BB())
end

```

i.e., just define your own function. You could probably automate this process using a macro and some introspection. But I agree with others that having functions from different packages be automatically ‘merged’ would probably lead to some very confusing behavior.

---

_[View the full topic](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335)._
