Skip to content

Commit 9a13df4

Browse files
committed
make dialyzer happy
1 parent 2bb2311 commit 9a13df4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/rebar_app_discover.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
%% @doc from the base directory, find all the applications
2020
%% at the top level and their dependencies based on the configuration
2121
%% and profile information.
22-
-spec do(rebar_state:t(), [file:filename()]) -> rebar_state:t().
22+
-spec do(rebar_state:t(), [file:filename()]) -> rebar_state:t() | no_return().
2323
do(State, LibDirs) ->
2424
BaseDir = rebar_state:dir(State),
2525
Dirs = [filename:join(BaseDir, LibDir) || LibDir <- LibDirs],

src/rebar_prv_vendor.erl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,20 @@ do_(InitState) ->
8888
State1 = rebar_state:set(InitState, project_app_dirs, NewAppDirs),
8989
{ok, State1}.
9090

91+
%% ignore the badmatch there; the error value is real, but comes from
92+
%% exceptions at the call-sites of sub-functions within
93+
%% `rebar_app_discovery:do/1' and Dialyzer loses track of this being
94+
%% a possibility and elides the `{error, _}' return tuple from the
95+
%% signature while it is real.
96+
-dialyzer({no_match, check_project_layout/1}).
9197
check_project_layout(State) ->
9298
%% Do a project_app_discover run, look for the project root,
9399
%% then drop the state.
94100
%% No need to drop the vendor config here if it exists because it
95101
%% only exists if we have the right structure.
96102
case rebar_prv_app_discovery:do(State) of
103+
{error, Reason} ->
104+
{error, Reason};
97105
{ok, TmpState} ->
98106
Apps = rebar_state:project_apps(TmpState),
99107
%% Code duplicated from rebar_prv_lock:define_root_app/2
@@ -106,8 +114,6 @@ check_project_layout(State) ->
106114
non_umbrella;
107115
error ->
108116
umbrella
109-
end;
110-
Other ->
111-
Other
117+
end
112118
end.
113119

0 commit comments

Comments
 (0)