aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_plt.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl
index afa46564dd..206c43e4e2 100644
--- a/lib/dialyzer/src/dialyzer_plt.erl
+++ b/lib/dialyzer/src/dialyzer_plt.erl
@@ -48,6 +48,7 @@
insert_exported_types/2,
lookup/2,
lookup_contract/2,
+ lookup_callbacks/2,
lookup_module/2,
merge_plts/1,
merge_plts_or_report_conflicts/2,
@@ -152,6 +153,19 @@ lookup_contract(#plt{contracts = Contracts},
{M, F, _} = MFA) when is_atom(M), is_atom(F) ->
table_lookup(Contracts, MFA).
+-spec lookup_callbacks(plt(), module()) -> [{mfa(),
+ {{Filename::string(),
+ Line::pos_integer()},
+ #contract{}}}].
+
+lookup_callbacks(#plt{callbacks = Callbacks}, Mod) when is_atom(Mod) ->
+ FunModFilter =
+ fun({M, _F, _A}, _Val) -> M =:= Mod;
+ ( _Key, _Val) -> false
+ end,
+ ModCallbacks = dict:filter(FunModFilter, Callbacks),
+ dict:to_list(ModCallbacks).
+
-spec delete_contract_list(plt(), [mfa()]) -> plt().
delete_contract_list(#plt{contracts = Contracts,