with 24.3.4
on WLS
-module(test).
-compile([nowarn_export_all, export_all]).
run(Values) ->
lists:all(fun erlang:is_integer/1, Values),
lists:any(fun erlang:is_integer/1, Values),
lists:foldl(fun erlang:is_integer/1, Values, Values),
lists:foldr(fun erlang:is_integer/1, Values, Values),
lists:mapfoldl(fun erlang:is_integer/1, Values, Values),
lists:mapfoldr(fun erlang:is_integer/1, Values, Values),
lists:map(fun erlang:is_integer/1, Values),
lists:flatmap(fun erlang:is_integer/1, Values),
lists:filter(fun erlang:is_integer/1, Values),
lists:foreach(fun erlang:is_integer/1, Values).
compile with inline_list_funcs
will get this warning:
erlc +inline_list_funcs test.erl
test.erl:6:5: Warning: this clause cannot match because a previous clause always matches
% 6| lists:all(fun erlang:is_integer/1, Values),
% | ^
test.erl:7:5: Warning: this clause cannot match because a previous clause always matches
% 7| lists:any(fun erlang:is_integer/1, Values),
% | ^
test.erl:8:5: Warning: this clause cannot match because its guard evaluates to 'false'
% 8| lists:foldl(fun erlang:is_integer/1, Values, Values),
% | ^
test.erl:9:5: Warning: this clause cannot match because its guard evaluates to 'false'
% 9| lists:foldr(fun erlang:is_integer/1, Values, Values),
% | ^
test.erl:10:5: Warning: this clause cannot match because its guard evaluates to 'false'
% 10| lists:mapfoldl(fun erlang:is_integer/1, Values, Values),
% | ^
test.erl:11:5: Warning: this clause cannot match because its guard evaluates to 'false'
% 11| lists:mapfoldr(fun erlang:is_integer/1, Values, Values),
% | ^
test.erl:12:5: Warning: the call to is_integer/1 has no effect
% 12| lists:map(fun erlang:is_integer/1, Values),
% | ^ ^
I’m working with warnings_as_errors
, this is a disaster for me