Skip to content

Commit

Permalink
fix dialyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ferd committed May 21, 2023
1 parent d7867e8 commit e650b56
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/rebar/src/rebar_base_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ ok_tuple(Source, Ws) ->
Warn :: string().
error_tuple(Source, Es, Ws, Opts) ->
{error, format_errors(Source, Es, []),
format_warnings(Source, Ws, [], Opts)}.
format_warnings(Source, Ws, dict:new(), Opts)}.

%% @doc format error and warning strings for a given source file
%% according to user preferences.
-spec error_tuple(file:filename(), [Err], [Warn], rebar_dict() | [{_,_}], [{_,_}]) ->
-spec error_tuple(file:filename(), [Err], [Warn], rebar_dict(), [{_,_}]) ->
error_tuple() when
Err :: string(),
Warn :: string().
Expand Down Expand Up @@ -226,7 +226,7 @@ format_errors(Source, Errors, Opts) ->
%% @private Formats and returns warning strings ready to be output.
-spec format_warnings(string(), [err_or_warn()]) -> [string()].
format_warnings(Source, Warnings) ->
format_warnings(Source, Warnings, [], []).
format_warnings(Source, Warnings, dict:new(), []).

%% @private Formats and returns warnings; chooses the distinct format they
%% may have based on whether `warnings_as_errors' option is on.
Expand Down Expand Up @@ -309,7 +309,6 @@ compiler_error_format(Opts) ->
%% `Opts' can be passed in both as a list or a dictionary depending
%% on whether the first call to rebar_erlc_compiler was done with
%% the type `rebar_dict()' or `rebar_state:t()'.
?DIAGNOSTIC("compiler error format: ~p~n", [Opts]),
LookupFn = if is_list(Opts) -> fun(K,L) -> lists:keyfind(K, 1, L) end
; true -> fun(K,O) -> rebar_opts:get(O, K, false) end
end,
Expand Down

0 comments on commit e650b56

Please sign in to comment.