Add get_true_type call to RB generator
authorMark Slee <mcslee@apache.org>
Fri, 31 Aug 2007 04:30:52 +0000 (04:30 +0000)
committerMark Slee <mcslee@apache.org>
Fri, 31 Aug 2007 04:30:52 +0000 (04:30 +0000)
Summary: Issue with typedefs failing, submitted by kevin clark @ powerset

Reviewed By: mcslee

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

compiler/cpp/src/generate/t_rb_generator.cc

index a15b9ce..2de2ed9 100644 (file)
@@ -329,13 +329,16 @@ void t_rb_generator::generate_field_defns(std::ofstream& out, t_struct* tstruct)
 }
 
 void t_rb_generator::generate_field_data(std::ofstream& out, t_type* field_type, const std::string& field_name = "") {
+  field_type = get_true_type(field_type);
+
   // Begin this field's defn
   out << "{:type => " << type_to_enum(field_type);
     
-  if (!field_name.empty())
+  if (!field_name.empty()) {
     out << ", :name => '" << field_name << "'";
+  }
 
-  if (! field_type->is_base_type()) {
+  if (!field_type->is_base_type()) {
     if (field_type->is_struct() || field_type->is_xception()) {
       out << ", :class => " << type_name(((t_struct*)field_type));
     } else if (field_type->is_list()) {