# Avoid error message for function name conflict

**URL:** <https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176>\
**Category:** General Usage\
**Created:** [April 7, 2020, 2:39pm UTC](https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176 "2020-04-07T14:39:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [April 7, 2020, 7:04pm UTC](https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176/4 "2020-04-07T19:04:52Z")

</div>

This is probably helpful:

> [@Function name conflict: ADL / function merging?](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335/24):
>
> Another option for this particular case: 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’ w…

It appears that either fully qualified names (as in `A.flatten`) or explit importing of all used objects are the only options.

However, one entry suggests to redefine the conflicting names to make the code “nicer” as in `myflatten(x) = A.flatten(x)`. That looks workable to me.

---

_[View the full topic](https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176)._
