Skip to content

Commit 016480b

Browse files
author
Yuki Ito
committed
Update docs for defoverridable and super
1 parent 857af06 commit 016480b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,13 +1717,12 @@ defmodule Kernel do
17171717
use DefaultMod
17181718
17191719
def test(x, y) do
1720-
x * y + super
1720+
x * y + super(x, y)
17211721
end
17221722
end
17231723
17241724
As seen as in the example `super` can be used to call the default
1725-
implementation, if no arguments are given to `super` it will be implictly
1726-
given the arguments of the current function.
1725+
implementation.
17271726
"""
17281727
defmacro defoverridable(tuples) do
17291728
quote do

lib/elixir/lib/kernel/special_forms.ex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,8 @@ defmodule Kernel.SpecialForms do
812812
defmacro __aliases__(args)
813813

814814
@doc """
815-
Calls the overriden function when overriding it with `defoverridable`. If no
816-
arguments are given to `super` the overriden function will be called with the
817-
same arguments as the current one. See `Kernel.defoverridable` for more
818-
information and documentation.
815+
Calls the overriden function when overriding it with `defoverridable`.
816+
See `Kernel.defoverridable` for more information and documentation.
819817
"""
820818
defmacro super(args)
821819
end

0 commit comments

Comments
 (0)