[erlang-bugs] Erlang R16B01: fun syntax and exception error: no case clause matching {location, 1} in function erl_lint:loc/1 (erl_lint.erl, line 577)
Dmitry Kolesnikov
dmkolesnikov@REDACTED
Sun Sep 8 21:06:26 CEST 2013
Hello,
I am not gonna comment here about correctness of given exception but crash is valid.
C and L are not defined variables at list comprehension. They have to be defined prior comprehension e.g.
C = a.
[ fun x:C/0 || A <- [b] ].
Best Regards,
Dmitry
On Sep 8, 2013, at 6:43 PM, Joseph Wayne Norton <norton@REDACTED> wrote:
>
> Hello.
>
> I accidentally stumbled upon the crash below with erl_lint:loc/1. I also noticed similar behavior with erlc when compiling a module with this same issue.
>
> I'm unsure of the expected behavior.
>
> Best regards,
>
> Joe N.
>
>
> $ erl
> Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
>
> Eshell V5.10.2 (abort with ^G)
> 1> [ fun x:A/0 || A <- [b] ].
> [#Fun<x.b.0>]
> 2> [ fun x:C/0 || A <- [b] ].
> ** exception error: no case clause matching {location,1}
> in function erl_lint:loc/1 (erl_lint.erl, line 577)
> in call from erl_lint:add_error/3 (erl_lint.erl, line 567)
> in call from erl_lint:expr_var/4 (erl_lint.erl, line 3049)
> in call from erl_lint:'-expr_list/3-fun-0-'/3 (erl_lint.erl, line 2154)
> in call from lists:foldl/3 (lists.erl, line 1248)
> in call from erl_lint:expr/3 (erl_lint.erl, line 2031)
> in call from erl_lint:handle_comprehension/4 (erl_lint.erl, line 2850)
> in call from erl_lint:expr/3 (erl_lint.erl, line 1957)
> 3>
>
>
> 3> [ fun x:A/0 || A <- [a] ].
> [#Fun<x.a.0>]
> 4> [ fun x:L/0 || A <- [a] ].
> ** exception error: no case clause matching {location,1}
> in function erl_lint:loc/1 (erl_lint.erl, line 577)
> in call from erl_lint:add_error/3 (erl_lint.erl, line 567)
> in call from erl_lint:expr_var/4 (erl_lint.erl, line 3049)
> in call from erl_lint:'-expr_list/3-fun-0-'/3 (erl_lint.erl, line 2154)
> in call from lists:foldl/3 (lists.erl, line 1248)
> in call from erl_lint:expr/3 (erl_lint.erl, line 2031)
> in call from erl_lint:handle_comprehension/4 (erl_lint.erl, line 2850)
> in call from erl_lint:expr/3 (erl_lint.erl, line 1957)
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
More information about the erlang-bugs
mailing list