Sample Code
defmodule Data do
defstruct name: "Alex"
end
defmodule Test do
def run(name) do
changeset = %Data{name: name}
|> case do
change when change.name == "" ->
IO.puts "NIL"
_ ->
IO.puts "WHAT??"
end
IO.puts changeset
end
end
- run code above, i met errors only when compiling with 1.10.4
- looks working in case of 1.11.1
Error message
Erlang/OTP 23 [erts-11.1.2] [source] [64-bit] [smp:40:40] [ds:40:40:10] [async-threads:1] [hipe]
** (CompileError) test.exs:11: cannot invoke remote function change.name/0 inside guards
(stdlib 3.13.2) lists.erl:1358: :lists.mapfoldl/3
(elixir 1.10.4) expanding macro: Kernel.|>/2
- assume that there are some differences to pass structures into |> operator between 1.10.4 and 1.11.1
- any idea or need to know where i can look up in elixir source code to find out associated with this.
Thanks.