Fix warning in generated source for alterl bindings
authorDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 00:58:41 +0000 (00:58 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 00:58:41 +0000 (00:58 +0000)
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?

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666423 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_alterl_generator.cc

index f27670f..996b2ad 100644 (file)
@@ -495,13 +495,13 @@ void t_alterl_generator::generate_service_interface(t_service* tservice) {
       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;
 }