THRIFT-2030 Thrift allows for inconsistent use of "oneway"

Patch: Jens Geyer
This commit is contained in:
Jens Geyer 2013-06-14 18:48:15 +02:00
parent b310ae7816
commit 70a5762736

View File

@ -42,6 +42,9 @@ class t_function : public t_doc {
arglist_(arglist), arglist_(arglist),
oneway_(oneway) { oneway_(oneway) {
xceptions_ = new t_struct(NULL); xceptions_ = new t_struct(NULL);
if (oneway_ && (! returntype_->is_void())) {
pwarning(1, "Oneway methods should return void.\n");
}
} }
t_function(t_type* returntype, t_function(t_type* returntype,
@ -58,6 +61,9 @@ class t_function : public t_doc {
if (oneway_ && !xceptions_->get_members().empty()) { if (oneway_ && !xceptions_->get_members().empty()) {
throw std::string("Oneway methods can't throw exceptions."); throw std::string("Oneway methods can't throw exceptions.");
} }
if (oneway_ && (! returntype_->is_void())) {
pwarning(1, "Oneway methods should return void.\n");
}
} }
~t_function() {} ~t_function() {}