[erlang-questions] Callback attribute removed from module_info in Erlang 19

Adam Lindberg hello@REDACTED
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):
http://erlang.org/pipermail/erlang-questions/2017-January/091485.html

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:
https://github.com/eproxus/meck/pull/169

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.

Cheers,
Adam




More information about the erlang-questions mailing list