erlang: Un-revert r988722
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991003 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/include/thrift_protocol_behaviour.hrl b/lib/erl/include/thrift_protocol_behaviour.hrl
index b75bb4a..abe300b 100644
--- a/lib/erl/include/thrift_protocol_behaviour.hrl
+++ b/lib/erl/include/thrift_protocol_behaviour.hrl
@@ -25,13 +25,13 @@
-spec flush_transport(state()) -> {state(), ok | {error, _Reason}}.
-spec close_transport(state()) -> {state(), ok | {error, _Reason}}.
--spec write(state(), term()) -> {state(), ok | {error, _Reason}}.
+-spec write(state(), any()) -> {state(), ok | {error, _Reason}}.
%% NOTE: Keep this in sync with thrift_protocol:read and read_specific.
-spec read
(state(), tprot_empty_tag()) -> {state(), ok | {error, _Reason}};
(state(), tprot_header_tag()) -> {state(), tprot_header_val() | {error, _Reason}};
- (state(), tprot_data_tag()) -> {state(), {ok, term()} | {error, _Reason}}.
+ (state(), tprot_data_tag()) -> {state(), {ok, any()} | {error, _Reason}}.
-endif.
diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl
index f7701b9..5c74adc 100644
--- a/lib/erl/src/thrift_client.erl
+++ b/lib/erl/src/thrift_client.erl
@@ -34,7 +34,7 @@
service = Service,
seqid = 0}}.
--spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, term()} | {error, term()}}.
+-spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, any()} | {error, any()}}.
call(Client = #tclient{}, Function, Args)
when is_atom(Function), is_list(Args) ->
case send_function_call(Client, Function, Args) of
@@ -61,7 +61,7 @@
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
--spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, term()}}.
+-spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, any()}}.
send_function_call(Client = #tclient{protocol = Proto0,
service = Service,
seqid = SeqId},
@@ -84,7 +84,7 @@
{Client#tclient{protocol = Proto4}, ok}
end.
--spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, term()} | {error, term()}}.
+-spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, any()} | {error, any()}}.
receive_function_result(Client = #tclient{service = Service}, Function) ->
ResultType = Service:function_info(Function, reply_type),
read_result(Client, Function, ResultType).
diff --git a/lib/erl/src/thrift_protocol.erl b/lib/erl/src/thrift_protocol.erl
index bb499ce..4c33412 100644
--- a/lib/erl/src/thrift_protocol.erl
+++ b/lib/erl/src/thrift_protocol.erl
@@ -120,10 +120,10 @@
%% NOTE: Keep this in sync with thrift_protocol_behaviour:read
-spec read
(#protocol{}, {struct, _Info}) -> {#protocol{}, {ok, tuple()} | {error, _Reason}};
- (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}};
+ (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}};
(#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}};
(#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}};
- (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}.
+ (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}.
read(IProto, {struct, {Module, StructureName}}) when is_atom(Module),
is_atom(StructureName) ->
@@ -180,7 +180,7 @@
-spec read_specific
(#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}};
(#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}};
- (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}.
+ (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}.
read_specific(Proto = #protocol{module = Module,
data = ModuleData}, ProtocolType) ->
{NewData, Result} = Module:read(ModuleData, ProtocolType),
@@ -219,7 +219,7 @@
{IProto2, ok} = read(IProto1, field_end),
read_struct_loop(IProto2, SDict, RTuple).
--spec skip(#protocol{}, term()) -> {#protocol{}, ok}.
+-spec skip(#protocol{}, any()) -> {#protocol{}, ok}.
skip(Proto0, struct) ->
{Proto1, ok} = read(Proto0, struct_begin),
@@ -308,11 +308,11 @@
%% | list() -- for list
%% | dictionary() -- for map
%% | set() -- for set
-%% | term() -- for base types
+%% | any() -- for base types
%%
%% Description:
%%--------------------------------------------------------------------
--spec write(#protocol{}, term()) -> {#protocol{}, ok | {error, _Reason}}.
+-spec write(#protocol{}, any()) -> {#protocol{}, ok | {error, _Reason}}.
write(Proto0, {{struct, StructDef}, Data})
when is_list(StructDef), is_tuple(Data), length(StructDef) == size(Data) - 1 ->