瀏覽代碼

Merge pull request #1280 from ferd/fix-warning-opts

Fix opts check when compiler called with dict opts
pull/1282/head
Fred Hebert 9 年之前
committed by GitHub
父節點
當前提交
fef403b341
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      src/rebar_base_compiler.erl

+ 7
- 1
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,

Loading…
取消
儲存