Skip to content

Commit

Permalink
Fix all dialyzer warnings in rabbitmq_jms_topic_exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
binarin authored and mergify[bot] committed Jan 23, 2023
1 parent 9db9db4 commit 684d960
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions deps/rabbitmq_jms_topic_exchange/BUILD.bazel
Expand Up @@ -24,25 +24,31 @@ RUNTIME_DEPS = [
"//deps/rabbit:erlang_app",
]

EXTRA_APPS = [
"mnesia",
]

rabbitmq_app(
app_description = APP_DESCRIPTION,
app_module = APP_MODULE,
app_name = APP_NAME,
runtime_deps = RUNTIME_DEPS,
deps = DEPS,
extra_apps = EXTRA_APPS,
)

xref()

plt(
name = "base_plt",
deps = DEPS,
plt = "//:base_plt",
apps = EXTRA_APPS,
deps = DEPS + RUNTIME_DEPS,
)

dialyze(
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
plt = ":base_plt",
warnings_as_errors = False,
)

broker_for_integration_suites()
Expand Down
Expand Up @@ -136,7 +136,7 @@ add_binding( Tx
case {Tx, BindGen} of
{transaction, {ok, BindFun}} ->
add_binding_fun(XName, {{BindingKey, Dest}, BindFun});
{none, {error, _}} ->
{none, error} ->
parsing_error(XName, Selector, Dest);
_ ->
ok
Expand Down Expand Up @@ -299,12 +299,14 @@ write_state_fun(XName, BFuns) ->
%% E R R O R S

% state error
-spec exchange_state_corrupt_error(#resource{}) -> no_return().
exchange_state_corrupt_error(#resource{name = XName}) ->
rabbit_misc:protocol_error( internal_error
, "exchange named '~ts' has no saved state or incorrect saved state"
, [XName] ).

% parsing error
-spec parsing_error(#resource{}, term(), #resource{}) -> no_return().
parsing_error(#resource{name = XName}, S, #resource{name = DestName}) ->
rabbit_misc:protocol_error( precondition_failed
, "cannot parse selector '~tp' binding destination '~ts' to exchange '~ts'"
Expand Down
5 changes: 3 additions & 2 deletions deps/rabbitmq_jms_topic_exchange/src/sjx_evaluator.erl
Expand Up @@ -34,8 +34,9 @@

-type expression() :: any().

-spec evaluate(expression(), table()) -> true | false | error.

-spec evaluate(expression(), table()) ->
'true' | 'false' | 'error' | 'undefined' | number() |
[ 'true' | 'false' | 'error' | 'undefined' | number() ].

evaluate( true, _Headers ) -> true;
evaluate( false, _Headers ) -> false;
Expand Down

0 comments on commit 684d960

Please sign in to comment.