Author: dreiss
Date: Tue Jun 10 17:58:41 2008
New Revision: 666423
URL: http://svn.apache.org/viewvc?rev=666423&view=rev
Log:
Fix warning in generated source for alterl bindings
Summary:
- Was previously including both the fall-through to the base service as well
as the "dummy" fallthrough function clause. This generated a warning like:
gen-erl/redacted_thrift.erl:134: Warning: this clause cannot match because a
previous clause at line 132 always matches
Now we only include the "dummy" function if there is no base class to fall
through to.
Test plan: Generated tutorial.thrift and shared.thrift, compiled without
warnings
Notes: It's probably possible to have a circular inheritance graph, which would
cause an infinite loop at runtime. Do we care about this?
Modified:
incubator/thrift/trunk/compiler/cpp/src/generate/t_alterl_generator.cc
Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_alterl_generator.cc
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_alterl_generator.cc?rev=666423&r1=666422&r2=666423&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_alterl_generator.cc
(original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_alterl_generator.cc Tue
Jun 10 17:58:41 2008
@@ -495,13 +495,13 @@
indent(f_service_) << "function_info(Function, InfoType) ->" << endl;
indent_up();
indent(f_service_) << uncapitalize(tservice->get_extends()->get_name())
- << "_thrift:function_info(Function, InfoType);" <<
endl;
+ << "_thrift:function_info(Function, InfoType)." <<
endl;
indent_down();
+ } else {
+ // Dummy function_info so we don't worry about the ;s
+ indent(f_service_) << "function_info(xxx, dummy) -> dummy." << endl;
}
- // Dummy function_info so we don't worry about the ;s
- indent(f_service_) << "function_info(xxx, dummy) -> dummy." << endl;
-
indent(f_service_) << endl;
}