aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_behaviours.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-11-10 13:33:58 +0100
committerStavros Aronis <[email protected]>2011-11-18 15:06:46 +0100
commitfc075ff9064eccd3ea2da0c067ec9ef01aaeb183 (patch)
treec8f863daa82a4f8365cd4a892134e0ec6c7b4ccb /lib/dialyzer/src/dialyzer_behaviours.erl
parentd101155c5dc115a51725b52e500c9a981845f2da (diff)
downloadotp-fc075ff9064eccd3ea2da0c067ec9ef01aaeb183.tar.gz
otp-fc075ff9064eccd3ea2da0c067ec9ef01aaeb183.tar.bz2
otp-fc075ff9064eccd3ea2da0c067ec9ef01aaeb183.zip
Allow none() as return value in callbacks
Diffstat (limited to 'lib/dialyzer/src/dialyzer_behaviours.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_behaviours.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/dialyzer/src/dialyzer_behaviours.erl b/lib/dialyzer/src/dialyzer_behaviours.erl
index b478af01df..82963783d8 100644
--- a/lib/dialyzer/src/dialyzer_behaviours.erl
+++ b/lib/dialyzer/src/dialyzer_behaviours.erl
@@ -110,11 +110,16 @@ check_all_callbacks(Module, Behaviour, [Cb|Rest], Plt, Acc) ->
Acc00 = Acc0,
{ReturnType, ArgTypes} = RetArgTypes,
Acc01 =
- case erl_types:t_is_none(erl_types:t_inf(ReturnType, CbReturnType)) of
- false -> Acc00;
- true ->
- [{callback_type_mismatch,[Behaviour, Function,
- Arity, ReturnType]}|Acc00]
+ case erl_types:t_is_subtype(ReturnType, CbReturnType) of
+ true -> Acc00;
+ false ->
+ case erl_types:t_is_none(
+ erl_types:t_inf(ReturnType, CbReturnType)) of
+ false -> Acc00;
+ true ->
+ [{callback_type_mismatch,[Behaviour, Function,
+ Arity, ReturnType]}|Acc00]
+ end
end,
Acc02 =
case erl_types:any_none(