Skip to content

Commit

Permalink
fix fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Khokhlov committed Apr 29, 2014
1 parent e4367fa commit c601ce3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/compiler/objc_primitive_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,17 +665,27 @@ namespace google { namespace protobuf { namespace compiler { namespace objective

void RepeatedPrimitiveFieldGenerator::GenerateDescriptionCodeSource(io::Printer* printer) const {
if (ReturnsPrimitiveType(descriptor_)) {
printer->Print(variables_,

printer->Print(variables_,
"for (NSNumber* value in self.$list_name$) {\n"
" [output appendFormat:@\"%@%@: %@\\n\", indent, @\"$name$\", @(($type$)value)];\n"
"}\n");

} else {

//TODO NEED TEST PRIMITIVES
printer->Print(variables_,
"for ($storage_type$ element in self.$list_name$) {\n"
" [output appendFormat:@\"%@%@: %@\\n\", indent, @\"$name$\", @(($type$)element)];\n"
"}\n");
"for ($storage_type$ element in self.$list_name$) {\n");

if (ReturnsPrimitiveType(descriptor_)) {
printer->Print(variables_," [output appendFormat:@\"%@%@: %@\\n\", indent, @\"$name$\", @(($type$)element)];\n");
}
else
{
printer->Print(variables_," [output appendFormat:@\"%@%@: %@\\n\", indent, @\"$name$\", element];\n");
}

printer->Print(variables_,"}\n");
}
}

Expand Down

0 comments on commit c601ce3

Please sign in to comment.