Hello,
I was trying to make a default implementation of a protocol via
defprotocol TheProtocol do
def fun1(...)
def fun2(...)
end
defimpl TheProtocol, for: Any do
def fun1(...) do
end
def fun2(...) do
end
end
where "TheProtocol" defines several functions.
Then I was trying
defimpl TheProtocol, for: Atom do
def fun1(...) do
...
end
end
and expecting that when calling
TheProtocol.fun2(an_atom, ...)
it would invoke the implementation in Any, but instead it complains with a warning that a fun2 is required but not implemented for Atom.
Is it possible to change @fallback_to_true so that it leverages the functions from Any when these are not implemented in another implementation?
To what I am aware of, this should not have semantic effects on existing applications, because these are providing complete protocol implementations.
Thanks
Mário