Skip to content

Commit b9c49c9

Browse files
author
José Valim
committed
Raise early on pipes into & special form
1 parent dc393ed commit b9c49c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/elixir/lib/macro.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ defmodule Macro do
6868
@spec pipe(Macro.t, Macro.t, integer) :: Macro.t | no_return
6969
def pipe(expr, call_args, integer \\ 0)
7070

71+
def pipe(expr, { :&, _, _ } = call_args, _integer) do
72+
raise ArgumentError, message: "cannot pipe #{to_string expr} into #{to_string call_args}"
73+
end
74+
7175
def pipe(expr, { call, line, atom }, integer) when is_atom(atom) do
7276
{ call, line, List.insert_at([], integer, expr) }
7377
end

0 commit comments

Comments
 (0)