diff options
author | Stavros Aronis <[email protected]> | 2013-03-25 16:46:01 +0100 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2013-04-08 11:26:59 +0200 |
commit | e45686ef2253ae2dcebab8baf47c0de6da56b5ae (patch) | |
tree | e81fee99938baf888cbd8d472d596c631d44872d /lib/dialyzer/src | |
parent | 7dab2fe62e255ba3cf9f9dfc2b9a73ce052b795a (diff) | |
download | otp-e45686ef2253ae2dcebab8baf47c0de6da56b5ae.tar.gz otp-e45686ef2253ae2dcebab8baf47c0de6da56b5ae.tar.bz2 otp-e45686ef2253ae2dcebab8baf47c0de6da56b5ae.zip |
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.
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r-- | lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 9 |
1 files changed, 6 insertions, 3 deletions
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", |