Hi everyone! I’m trying to understand
this piece of Mox source code.
I get the part of adding the
behaviour attribute to the generated module, but why is the reference to the behaviour module included by itself
? Not seen this pattern before. I guess the clue is in the function name, but I wanted to be sure.
Yep, super strange that it isn’t just
If I had to guess it might be an aliasing thing, but that still doesn’t make sense to me.
module_info might trigger some cache busting or otherwise refreshing of all implementations of the behaviour.
Digging through the source history, that generated call to
module_info predates the use of
@behaviour and was originally introduced to ensure that the generated module recompiled at the correct times:
07:12PM - 09 Nov 17 UTC
08:59PM - 09 Nov 17 UTC
So I am using the latest version released 0.3.0. I am seeing a strange issue
@behaviour line was added later, and without disturbing the existing line: