Skip to content

Commit a6da9e5

Browse files
author
José Valim
committed
Document defines? does not include overridable, closes #8896
1 parent 8d28d77 commit a6da9e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/elixir/lib/module.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,11 @@ defmodule Module do
921921
Use `Kernel.function_exported?/3` and `Kernel.macro_exported?/3` to check for
922922
public functions and macros respectively in compiled modules.
923923
924+
Note that `defines?` returns false for functions and macros that have
925+
been defined but then marked as overridable and no other implementation
926+
has been provided. You can check the overridable status by calling
927+
`overridable?/2`.
928+
924929
## Examples
925930
926931
defmodule Example do
@@ -1052,6 +1057,11 @@ defmodule Module do
10521057
An overridable function is lazily defined, allowing a
10531058
developer to customize it. See `Kernel.defoverridable/1` for
10541059
more information and documentation.
1060+
1061+
Once a function or macro are marked as overridable, it will
1062+
no longer be listed under `definitions_in/1` or return true
1063+
when given to `defines?/2` until another implementation is
1064+
given.
10551065
"""
10561066
@spec make_overridable(module, [definition]) :: :ok
10571067
def make_overridable(module, tuples) when is_atom(module) and is_list(tuples) do

0 commit comments

Comments
 (0)