[erlang-questions] Callback attribute removed from module_info in Erlang 19
Mon Feb 13 12:31:10 CET 2017
This is a continuation of a previous discussion (I wasn’t subscribed to the mailing list at that time):
The regression of removing the callback attributes in Erlang 19 is that Meck can no longer be used on callback modules (gen_server, etc.). The reason why is described here:
In summary, it is because the new version of Erlang doesn’t “tell” Meck about the callbacks anymore, the module gets mocked without them. Then, other modules which uses that behaviour fails to compile (because the behaviour doesn’t exist anymore, although the module does).
Meck creates its own version of the module, matching the signature, then uses Mod:module_info(attributes) to get the attributes and includes those. This is what has changed in Erlang 19.
Not sure what the solution here should be, I can only comment on that it is a pretty big regression for Meck (ruling out behaviour mocking for now) with a non-trivial fix.
More information about the erlang-questions