The only possible way to refactor here is to rename one of the macros/functions.
def foo(bar, baz \\ []), do: ...
def foo(quux, bar, baz \\ %{}), do ...
is getting expanded at compile time to the following:
def foo(bar), do: foo(bar, [])
def foo(bar, baz), do: ...
def foo(quux, bar), do: foo(quux, bar, %{})
def foo(quux, bar, baz), do: ...
As you can see, there are now 2 foo/2, which is the mentioned conflict in the error you posted.






















