You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens-G (via GitHub)" <gi...@apache.org> on 2025/04/06 00:24:52 UTC
Re: [PR] Erlang generator improvements [thrift]
Jens-G commented on code in PR #3120:
URL: https://github.com/apache/thrift/pull/3120#discussion_r2030000155
##########
compiler/cpp/src/thrift/generate/t_erl_generator.cc:
##########
@@ -715,21 +755,30 @@ string t_erl_generator::render_default_value(t_field* field) {
return "dict:new()";
}
} else if (type->is_set()) {
- return "sets:new()";
+ return render_default_sets_value();
} else if (type->is_list()) {
return "[]";
} else {
return "undefined";
}
}
+string t_erl_generator::render_default_sets_value() {
+ switch (sets_to_) {
+ case SetsTo::V1:
+ return "sets:new()";
+ case SetsTo::V2:
+ return "sets:new([{version,2}])";
+ }
+}
Review Comment:
there's something missing obviosuly
##########
compiler/cpp/src/thrift/generate/t_erl_generator.cc:
##########
@@ -761,6 +810,17 @@ string t_erl_generator::render_member_type(t_field* field) {
}
}
+string t_erl_generator::render_string_type() {
+ switch (string_to_) {
+ case StringTo::String:
+ return "string()";
+ case StringTo::Binary:
+ return "binary()";
+ case StringTo::Both:
+ return "string() | binary()";
+ }
+}
Review Comment:
same here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org