summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-11-11 19:00:35 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2010-11-11 19:00:35 +0000
commitc5035d704a75a1b829a845fc475f7ece7df085db (patch)
treedb69c698c21a9de43ecac725cefc375adc445207
parentc53d1a68dc44a5fed209f5e36c2b2de84a3ea67b (diff)
downloadrabbitmq-server-c5035d704a75a1b829a845fc475f7ece7df085db.tar.gz
Correction of specs
-rw-r--r--src/rabbit_misc.erl15
-rw-r--r--src/rabbit_upgrade.erl7
2 files changed, 15 insertions, 7 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index d8eef7e8..ef949836 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -76,7 +76,7 @@
-ifdef(use_specs).
--export_type([resource_name/0, module_attributes/0, modules_attributes/0]).
+-export_type([resource_name/0]).
-type(ok_or_error() :: rabbit_types:ok_or_error(any())).
-type(thunk(T) :: fun(() -> T)).
@@ -84,9 +84,6 @@
-type(optdef() :: {flag, string()} | {option, string(), any()}).
-type(channel_or_connection_exit()
:: rabbit_types:channel_exit() | rabbit_types:connection_exit()).
--type(module_attributes() :: [term()]).
--type(modules_attributes() :: [{atom(), module_attributes()}]).
-
-spec(method_record_type/1 :: (rabbit_framing:amqp_method_record())
-> rabbit_framing:amqp_method_name()).
@@ -187,7 +184,15 @@
-spec(unlink_and_capture_exit/1 :: (pid()) -> 'ok').
-spec(get_options/2 :: ([optdef()], [string()])
-> {[string()], [{string(), any()}]}).
--spec(all_module_attributes/1 :: (atom()) -> modules_attributes()).
+-spec(all_module_attributes/1 :: (atom()) -> [{atom(), [term()]}]).
+-type(graph_vertex_fun() ::
+ fun ((atom(), [term()]) -> {digraph:vertex(), digraph:label()})).
+-type(graph_edge_fun() ::
+ fun ((atom(), [term()]) -> {digraph:vertex(), digraph:vertex()})).
+-type(graph_error_fun() :: fun ((any()) -> any() | no_return())).
+-spec(build_acyclic_graph/4 :: (graph_vertex_fun(), graph_edge_fun(),
+ graph_error_fun(), [{atom(), [term()]}]) ->
+ digraph()).
-spec(now_ms/0 :: () -> non_neg_integer()).
-endif.
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index eeaa4c62..97c82ef2 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -32,11 +32,14 @@
-ifdef(use_specs).
--spec(maybe_upgrade/0 :: () -> 'ok' | 'version_not_available' | no_return()).
+-spec(maybe_upgrade/0 :: () -> 'ok' | 'version_not_available').
-spec(read_version/0 ::
() -> {'ok', [any()]} | rabbit_types:error(any())).
-spec(write_version/0 :: () -> 'ok').
--spec(desired_version/0 :: () -> [any()]).
+-spec(desired_version/0 :: () -> [atom()]).
+
+%% only here to shut dialyzer up
+-spec(apply_upgrades/1 :: ([{atom(), atom()}]) -> 'ok' | no_return()).
-endif.