File tree 1 file changed +4
-2
lines changed
compiler/cpp/src/generate
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ void t_json_generator::end_array() {
239
239
240
240
void t_json_generator::write_type_spec_object (const char * name, t_type* ttype) {
241
241
ttype = ttype->get_true_type ();
242
- if (ttype->is_struct () || ttype->is_xception () || ttype->is_container ()) {
242
+ if (ttype->is_struct () || ttype->is_xception () || ttype->is_container () || ttype-> is_enum () ) {
243
243
write_key_and (name);
244
244
start_object (NO_INDENT);
245
245
write_key_and (" typeId" );
@@ -271,6 +271,8 @@ void t_json_generator::write_type_spec(t_type* ttype) {
271
271
t_type* etype = ((t_list*)ttype)->get_elem_type ();
272
272
write_key_and_string (" elemTypeId" , get_type_name (etype));
273
273
write_type_spec_object (" elemType" , etype);
274
+ } else if (ttype->is_enum ()) {
275
+ write_key_and_string (" class" , get_qualified_name (ttype));
274
276
}
275
277
}
276
278
@@ -707,7 +709,7 @@ string t_json_generator::get_type_name(t_type* ttype) {
707
709
return " map" ;
708
710
}
709
711
if (ttype->is_enum ()) {
710
- return " i32 " ;
712
+ return " enum " ;
711
713
}
712
714
if (ttype->is_struct ()) {
713
715
return ((t_struct*)ttype)->is_union () ? " union" : " struct" ;
You can’t perform that action at this time.
0 commit comments