summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_base_compiler.erl8
-rw-r--r--src/rebar_prv_dialyzer.erl2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl
index 6b8c7ca..5d54057 100644
--- a/src/rebar_base_compiler.erl
+++ b/src/rebar_base_compiler.erl
@@ -155,7 +155,13 @@ format_warnings(Source, Warnings) ->
format_warnings(Source, Warnings, []).
format_warnings(Source, Warnings, Opts) ->
- Prefix = case lists:member(warnings_as_errors, Opts) of
+ %% `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()'.
+ LookupFn = if is_list(Opts) -> fun lists:member/2
+ ; true -> fun dict:is_key/2
+ end,
+ Prefix = case LookupFn(warnings_as_errors, Opts) of
true -> "";
false -> "Warning: "
end,
diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl
index 82d2d07..fc13de1 100644
--- a/src/rebar_prv_dialyzer.erl
+++ b/src/rebar_prv_dialyzer.erl
@@ -260,6 +260,8 @@ read_plt(_State, Plt) ->
Result;
{error, no_such_file} ->
error;
+ {error, not_valid} ->
+ error;
{error, read_error} ->
Error = io_lib:format("Could not read the PLT file ~p", [Plt]),
throw({dialyzer_error, Error})