Re: [elixir-core:9703] nested captures via & are not allowed

2020-09-11 Thread José Valim
The & has low precedence (low binding). Therefore, "value ~> &op/1 ~> &op2/1" is being parsed as "value ~> &(op/1 ~> &op2/1)", which is where the warning comes from. Proof: iex(1)> Macro.to_string(quote do: value ~> &op/1 ~> &op2/1) "value ~> &(op / 1 ~> &op2/1)" -- You received this message be

[elixir-core:9703] nested captures via & are not allowed

2020-09-11 Thread ivan.y...@gmail.com
I just ran into this error "nested captures via & are not allowed" having no nested captures whatsoever,, but using captures in a chain of operations with custom operator, like this: `value ~> &op/1 ~> &op2/1` where ~> is basically an alias for some function, so when rewritten it looks like this