@@ -297,6 +297,8 @@ defmodule Module do
297297 When just a module is provided, the function is assumed to be
298298 `__after_compile__/2`.
299299
300+ Callbacks registered first will run last.
301+
300302 #### Example
301303
302304 defmodule MyModule do
@@ -312,13 +314,18 @@ defmodule Module do
312314 A hook that will be invoked before the module is compiled.
313315
314316 Accepts a module or a `{module, function_or_macro_name}` tuple. The
315- function/macro must take one argument: the module environment. If it's a
316- macro, its returned value will be injected at the end of the module definition
317- before the compilation starts.
317+ function/macro must take one argument: the module environment. If
318+ it's a macro, its returned value will be injected at the end of the
319+ module definition before the compilation starts.
318320
319321 When just a module is provided, the function/macro is assumed to be
320322 `__before_compile__/1`.
321323
324+ Callbacks registered first will run last. Any overridable definition
325+ will be made concrete before the first callback runs. A definition may
326+ be made overridable again in another before compile callback and it
327+ will be made concrete one last time after after all callbacks run.
328+
322329 *Note*: unlike `@after_compile`, the callback function/macro must
323330 be placed in a separate module (because when the callback is invoked,
324331 the current module does not yet exist).
0 commit comments