bool t_erl_generator::has_default_value(t_field * field) {
t_type *type = field->get_type();
if (!field->get_value()) {
- if (type->is_struct() || type->is_xception() || type->is_map() ||
- type->is_set() || type->is_list()) {
- return true;
+ if ( field->get_req() == t_field::T_REQUIRED) {
+ if (type->is_struct() || type->is_xception() || type->is_map() ||
+ type->is_set() || type->is_list()) {
+ return true;
+ } else {
+ return false;
+ }
} else {
return false;
}
+struct StructB
+{
+ 1: string x
+}
+
struct StructA
{
1: string a,
15: double o = 3.14159,
16: list<string> string_list,
17: list<byte> byte_list = [1, 2, 3],
- 18: set<string> string_set,
- 19: map<string, string> string_map
+ 18: required list<string> rsl,
+ 19: optional list<string> osl,
+ 20: set<string> string_set,
+ 21: required set<string> rss,
+ 22: optional set<string> oss,
+ 23: map<string, string> string_map,
+ 24: required map<string, string> rsm,
+ 25: optional map<string, string> osm,
+ 26: StructB structb
}