Update lib/elixir/lib/record.ex

Use record field value in the exception message
This commit is contained in:
José Valim
2012-11-25 20:15:32 +01:00
parent 9a7bdc158a
commit f97b3cea18
+2 -2
View File
@@ -519,10 +519,10 @@ defmodule Record do
defp convert_value(atom) when is_atom(atom), do: { atom, nil }
defp convert_value({ atom, other }) when is_atom(atom) and is_function(other), do:
raise ArgumentError, message: "record field #{inspect atom} cannot be a function"
raise ArgumentError, message: "record field value #{inspect atom} cannot be a function"
defp convert_value({ atom, other }) when is_atom(atom) and (is_reference(other) or is_pid(other) or is_port(other)), do:
raise ArgumentError, message: "record field #{inspect atom} cannot be a reference, pid or port"
raise ArgumentError, message: "record field value #{inspect atom} cannot be a reference, pid or port"
defp convert_value({ atom, _ } = tuple) when is_atom(atom), do: tuple