Skip to content

Commit 060f262

Browse files
committed
Add more context around @after_compile
1 parent dfb2f1c commit 060f262

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/elixir/lib/module.ex

+5-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ defmodule Module do
524524
525525
### `@after_compile`
526526
527-
A hook that will be invoked right after the current module is compiled.
527+
A hook that will be invoked with the bytecode of the current module.
528+
Although the module has already been compiled, its bytecode may not have
529+
been loaded to memory nor written to disk. For those reasons, prefer to
530+
use `@after_verify` callbacks or use `Code.ensure_compiled!/1` to wait
531+
until the module is fully available for introspection/invocation.
528532
529533
Accepts a module or a `{module, function_name}` tuple. The function
530534
must take two arguments: the module environment and its bytecode.

0 commit comments

Comments
 (0)