THRIFT-3545 Cocoa: Container type literals do not compile
Client: Cocoa
Patch: Christopher Rogers <christopher.rogers@linecorp.com>
This closes #790
diff --git a/compiler/cpp/src/generate/t_cocoa_generator.cc b/compiler/cpp/src/generate/t_cocoa_generator.cc
index 8ea2400..c27d612 100644
--- a/compiler/cpp/src/generate/t_cocoa_generator.cc
+++ b/compiler/cpp/src/generate/t_cocoa_generator.cc
@@ -2758,7 +2758,7 @@
mapout << ", ";
}
}
- mapout << "}";
+ mapout << "};" << endl;
out << mapout.str();
} else if (type->is_list()) {
ostringstream listout;
@@ -2775,7 +2775,7 @@
listout << ", ";
}
}
- listout << "]";
+ listout << "];" << endl;
out << listout.str();
} else if (type->is_set()) {
ostringstream setout;
@@ -2785,14 +2785,14 @@
vector<t_const_value*>::const_iterator v_iter;
if (defval)
setout << type_name(type) << " ";
- setout << name << " = NSSet setWithArray:@[";
+ setout << name << " = [[NSSet alloc] initWithArray:@[";
for (v_iter = val.begin(); v_iter != val.end();) {
setout << render_const_value(out, etype, *v_iter, true);
if (++v_iter != val.end()) {
setout << ", ";
}
}
- setout << "]]";
+ setout << "]];" << endl;
out << setout.str();
} else {
throw "compiler error: no const of type " + type->get_name();