From e4526b30228f360d2c8c894376f3856b9fc83c09 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Fri, 31 Jan 2014 12:06:51 +0200 Subject: Shut off a dialyzer unmatched return warning Dialyzer does not like list comprehensions for which the result is not assigned to some variable (maybe anonymous). In this particular case, the comprehension, containing only a filter but no generator, was used to save some lines, but IMO this type of code, while "cute", is not so easy to comprehend. --- lib/dialyzer/src/dialyzer_typesig.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl index b4b3d5a092..70e14781f7 100644 --- a/lib/dialyzer/src/dialyzer_typesig.erl +++ b/lib/dialyzer/src/dialyzer_typesig.erl @@ -2535,8 +2535,10 @@ enter_type(Key, Val, Map) when is_integer(Key) -> erase_type(Key, Map); false -> LimitedVal = t_limit(Val, ?INTERNAL_TYPE_LIMIT), - [?debug("LimitedVal ~s\n", [format_type(LimitedVal)]) || - not is_equal(LimitedVal, Val)], + case is_equal(LimitedVal, Val) of + true -> ok; + false -> ?debug("LimitedVal ~s\n", [format_type(LimitedVal)]) + end, case dict:find(Key, Map) of {ok, Value} -> case is_equal(Value, LimitedVal) of -- cgit v1.2.3