From feeaaadd6101b57a9e1b044f4dc3001e9c475c44 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Wed, 30 Nov 2011 14:06:20 +0100 Subject: Refine warning about callback specs with extra ranges --- lib/dialyzer/src/dialyzer_behaviours.erl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/dialyzer/src/dialyzer_behaviours.erl') diff --git a/lib/dialyzer/src/dialyzer_behaviours.erl b/lib/dialyzer/src/dialyzer_behaviours.erl index 6295a5259e..900ddf28c5 100644 --- a/lib/dialyzer/src/dialyzer_behaviours.erl +++ b/lib/dialyzer/src/dialyzer_behaviours.erl @@ -152,10 +152,12 @@ check_all_callbacks(Module, Behaviour, [Cb|Rest], Acc11 = case erl_types:t_is_subtype(SpecReturnType, CbReturnType) of true -> Acc10; - false -> [{callback_spec_type_mismatch, - [File, Line, Behaviour, Function, Arity, - erl_types:t_to_string(SpecReturnType, Records), - erl_types:t_to_string(CbReturnType, Records)]}|Acc10] + false -> + ExtraType = erl_types:t_subtract(SpecReturnType, CbReturnType), + [{callback_spec_type_mismatch, + [File, Line, Behaviour, Function, Arity, + erl_types:t_to_string(ExtraType, Records), + erl_types:t_to_string(CbReturnType, Records)]}|Acc10] end, Acc12 = case erl_types:any_none( -- cgit v1.2.3