Skip to content

Commit 9764f3f

Browse files
committed
Fix functions as default values in records
successful check_value/2 needs to return its second argument
1 parent b1915b1 commit 9764f3f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/elixir/lib/record.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ defmodule Record do
916916
raise ArgumentError, message: "record field default value #{inspect atom} can only contain " <>
917917
"functions that point to an existing &Mod.fun/arity"
918918
end
919+
other
919920
end
920921

921922
defp check_value(atom, other) when is_reference(other) or is_pid(other) or is_port(other) do

0 commit comments

Comments
 (0)