From e45686ef2253ae2dcebab8baf47c0de6da56b5ae Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Mon, 25 Mar 2013 16:46:01 +0100 Subject: Fix notification for duplicate modules Dialyzer fails when asked to analyze multiple modules with the same name, but the error message was erroneous. With this patch Dialyzer generates a correct error message. Bug reported and patch submitted by Maxim Treskin. --- lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index 86618a4915..75be2a8b46 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -255,10 +255,13 @@ compile_and_store(Files, #analysis_state{codeserver = CServer, CServer2 = dialyzer_codeserver:set_next_core_label(NextLabel, CServer), case Failed =:= [] of true -> - NewFiles = lists:zip(lists:reverse(Modules), Files), ModDict = - lists:foldl(fun({Mod, F}, Dict) -> dict:append(Mod, F, Dict) end, - dict:new(), NewFiles), + lists:foldl(fun(F, Dict) -> + ModFile = lists:last(filename:split(F)), + Mod = filename:basename(ModFile, ".beam"), + dict:append(Mod, F, Dict) + end, + dict:new(), Files), check_for_duplicate_modules(ModDict); false -> Msg = io_lib:format("Could not scan the following file(s): ~p", -- cgit v1.2.3