mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
THRIFT-570. Thrift compiler does not error when duplicate method names are present
This patch causes the compiler to throw an exception when duplicate method names are found. Patch: Bruce Simpson git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984628 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
38bab12298
commit
34b530f099
@ -44,6 +44,12 @@ class t_service : public t_type {
|
||||
}
|
||||
|
||||
void add_function(t_function* func) {
|
||||
std::vector<t_function*>::const_iterator iter;
|
||||
for (iter = functions_.begin(); iter != functions_.end(); iter++) {
|
||||
if (func->get_name() == (*iter)->get_name()) {
|
||||
throw "Function " + func->get_name() + " is already defined";
|
||||
}
|
||||
}
|
||||
functions_.push_back(func);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user