[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)

Joseph Wayne Norton <>
Mon Sep 9 05:30:10 CEST 2013


Yes, understood - thanks.

I am simply expecting a crash report similar to this one:

$ 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> [ C || A <- [b]].
* 1: variable 'C' is unbound

Best regards,

Joe N.


On 2013/09/09, at 4:06, Dmitry Kolesnikov <> wrote:

> 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 <> 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
>> 
>> http://erlang.org/mailman/listinfo/erlang-bugs
> 



More information about the erlang-bugs mailing list