happy icon indicating copy to clipboard operation
happy copied to clipboard

illegal pattern

Open OvermindDL1 opened this issue 8 years ago • 2 comments

Given this reduced test:

IO.inspect({:ok, str} when is_binary(str) = get_a_string_or_whatever())

It gives an 'illegal pattern' error at compile-time of:

 ** (CompileError) web/controllers/index_controller.ex:8: illegal pattern
    (stdlib) lists.erl:1338: :lists.foreach/2
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

OvermindDL1 avatar Aug 25 '16 16:08 OvermindDL1

Unsure how fixable this one is, but normal matching without the 'when' works.

OvermindDL1 avatar Aug 25 '16 16:08 OvermindDL1

Probably should be ignored now that I'm thinking of it, I'd say only top-level ones should be watched for perhaps?

OvermindDL1 avatar Aug 25 '16 18:08 OvermindDL1