Skip to content

Commit

Permalink
Fix notification for duplicate modules
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aronisstav committed Apr 8, 2013
1 parent 7dab2fe commit e45686e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/dialyzer/src/dialyzer_analysis_callgraph.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e45686e

Please sign in to comment.