From c2917b31d4fa9ae8fb3eed146028c84f61ef9dc7 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 10 Oct 2010 23:24:20 +0200 Subject: [PATCH] Fix issues found by dialyzer --- src/rebar_erlc_compiler.erl | 9 +++++---- src/rebar_xref.erl | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index dc80e4f..e0d4def 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -129,12 +129,12 @@ doterl_compile(Config, OutDir, MoreSources) -> %% Make sure that ebin/ exists and is on the path ok = filelib:ensure_dir(filename:join("ebin", "dummy.beam")), CurrPath = code:get_path(), - code:add_path("ebin"), + true = code:add_path("ebin"), rebar_base_compiler:run(Config, NewFirstErls, OtherErls, fun(S, C) -> internal_erl_compile(S, C, OutDir, ErlOpts) end), - code:set_path(CurrPath), + true = code:set_path(CurrPath), ok. @@ -298,11 +298,12 @@ delete_dir(Dir, Subdirs) -> lists:foreach(fun(D) -> delete_dir(D, dirs(D)) end, Subdirs), file:del_dir(Dir). --spec compile_priority(File::string()) -> pos_integer(). +-spec compile_priority(File::string()) -> 'normal' | 'behaviour' | + 'parse_transform'. compile_priority(File) -> case epp_dodger:parse_file(File) of {error, _} -> - 10; % couldn't parse the file, default priority + normal; % couldn't parse the file, default priority {ok, Trees} -> F2 = fun({tree,arity_qualifier,_, {arity_qualifier,{tree,atom,_,behaviour_info}, diff --git a/src/rebar_xref.erl b/src/rebar_xref.erl index 19700d3..55b4f0e 100644 --- a/src/rebar_xref.erl +++ b/src/rebar_xref.erl @@ -42,7 +42,7 @@ xref(Config, _) -> %% Spin up xref - xref:start(xref), + {ok, _} = xref:start(xref), ok = xref:set_library_path(xref, code_path()), xref:set_default(xref, [{warnings, rebar_config:get(Config, xref_warnings, false)}, {verbose, rebar_config:is_verbose()}]),