[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393799#comment-16393799 ] ASF GitHub Bot commented on THRIFT-4495: Github user asfgit closed the pull request at: https://github.com/apache/thrift/pull/1494 > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393734#comment-16393734 ] ASF GitHub Bot commented on THRIFT-4495: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/1494 Ugh, build failure is dlang related, not to this. > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393733#comment-16393733 ] ASF GitHub Bot commented on THRIFT-4495: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/1494 I'm running this and 4497 through local tests since it wasn't based on good CI builds. > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16388696#comment-16388696 ] ASF GitHub Bot commented on THRIFT-4495: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/1494 Hi, please rebase this on the current master and force push to kick a new build - I think the CI build environment is stable again. > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362836#comment-16362836 ] ASF GitHub Bot commented on THRIFT-4495: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/1494 We use these versions in CI today, FYI: trusty: R16B03 xenial: 18.3 (this is the one we run "make cross" under) artful: 20.0.4 > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-4495) Erlang records should allow 'undefined' for non-required fields
[ https://issues.apache.org/jira/browse/THRIFT-4495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362761#comment-16362761 ] ASF GitHub Bot commented on THRIFT-4495: GitHub user dhull opened a pull request: https://github.com/apache/thrift/pull/1494 THRIFT-4495: Allow `undefined` for non-required Erlang records fields. 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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/dhull/thrift thrift-4495-erlang-undefined-fields Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/1494.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1494 commit 332587370e89919fa34fcbab74d1bd99174d8e1a Author: David HullDate: 2018-02-13T01:11:24Z THRIFT-4495: Allow `undefined` for non-required Erlang records fields. 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. > Erlang records should allow 'undefined' for non-required fields > --- > > Key: THRIFT-4495 > URL: https://issues.apache.org/jira/browse/THRIFT-4495 > Project: Thrift > Issue Type: Improvement > Components: Erlang - Compiler >Affects Versions: 0.11.0 >Reporter: David Hull >Assignee: David Hull >Priority: Major > > The Erlang records created by the Erlang code generator allow only the type > declared by the Thrift definition file. If a field is not required, however, > the Erlang record should also allow the value {{undefined}} (this is similar > to a null value in other languages). > Erlang includes a tool, dialyzer, that does type analysis of Erlang code. > Until Erlang 19, dialyzer implicitly added `undefined` as an allowed type for > all record fields, but as of Erlang 19 it no longer does. This means that > dialyzer now emits error messages whenever a record is constructed and > initial values are not specified for all of its fields. > So, for example, the following thrift definition > {noformat} > struct Test { > 1: required i32 a > 2: i32 b > 3: optional i32 c > }{noformat} > currently produced the following Erlang record: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer(), > 'c' :: integer()}).{noformat} > However it should produce the following: > {noformat} > -record('Test', {'a' :: integer(), > 'b' :: integer() | undefined, > 'c' :: integer() | undefined}).{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)