Skip to content

Commit 8ff5c76

Browse files
haulethjosevalim
authored andcommitted
Set correct value returned by get_fun/2 callback (#10842)
By looking at source of `Access.all/0` it seems that returned value by this function is `container()` instead of tuple `{val, container()}`.
1 parent 51de0e0 commit 8ff5c76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/elixir/lib/access.ex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ defmodule Access do
9999
@type key :: any
100100
@type value :: any
101101

102-
@type get_fun(data, current_value) ::
103-
(:get, data, (term -> term) ->
104-
{current_value, new_data :: container})
102+
@type get_fun(data) ::
103+
(:get, data, (term -> term) -> new_data :: container)
105104

106105
@type get_and_update_fun(data, current_value) ::
107106
(:get_and_update, data, (term -> term) ->
108107
{current_value, new_data :: container} | :pop)
109108

110109
@type access_fun(data, current_value) ::
111-
get_fun(data, current_value) | get_and_update_fun(data, current_value)
110+
get_fun(data) | get_and_update_fun(data, current_value)
112111

113112
@doc """
114113
Invoked in order to access the value stored under `key` in the given term `term`.

0 commit comments

Comments
 (0)