Open jjl opened 6 years ago
Hmm, it's hard to do that though as it creates and rebinds itself a few times as it builds up the protocol, especially when re-compiling over itself, so if I add that then it would warn on every recompile for example... As for defimpl_ex's, they should already work fine, a quick test shows:
warning: redefining module Bloop.Integer (current version defined in memory)
So that is good. Any ideas on how to handle protocol_ex's themselves considering they rewrite themselves a few times to build up to allow recursive-referencing implementations?
I get warning: redefining module Blah (current version defined in memory)
when trying to compile a protocol and module with the same name as well.
And I get warning: redefining module :"Elixir.Blah.$ProtocolEx_description$" (current version defined in memory)
with duplicate protocol's as well, it looks like it warns in every case?
Do you have a specific example where it does not warn?
I was just doing some heavy refactoring and forgot to remove a protocol_ex that shared a name with a new module. It took me a little while to figure out protocol_ex was overwriting my module silently. It would have been lovely to get a message something like this:
In this case, it was the name of a protocol_ex, but it makes sense to do the same for names of defimpls