When I write one-liner definitions, and forget to write do:, like so:
iex(1)> defmodule Test do
...(1)> def foo(), true
...(1)> end
the compiler will result in:
** (CompileError) iex:2: invalid arguments for "try"
iex:2: (module)
Which is a bit confusing. Maybe there could be a better error message.
Thanks, I have verified this on master. Please don't forget to include the Elixir version in upcoming reports. :)
I will push a fix soon. We raise for missing :do in some cases but not in others, I will make sure we raise it consistently.
Most helpful comment
I will push a fix soon. We raise for missing :do in some cases but not in others, I will make sure we raise it consistently.