THRIFT-4495: Allow undefined for non-required Erlang records fields.

Client: erl

As of Erlang 19, the dialyzer static type-analysis tool no longer
implicitly adds `undefined` to the allowed types for a field.  This
means that dialyzer will now complain about any non-required fields
that are not explicitly initialed when creating a new record.

This closes #1494
This commit is contained in:
David Hull 2018-02-13 01:11:24 +00:00 committed by James E. King III
parent 50862915cc
commit 1918b21d1c

View File

@ -810,6 +810,8 @@ void t_erl_generator::generate_erl_struct_member(ostream& out, t_field* tmember)
if (has_default_value(tmember))
out << " = " << render_member_value(tmember);
out << " :: " << render_member_type(tmember);
if (tmember->get_req() != t_field::T_REQUIRED)
out << " | 'undefined'";
}
bool t_erl_generator::has_default_value(t_field* field) {