[ https://issues.apache.org/jira/browse/THRIFT-2628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152724#comment-14152724 ]
ASF GitHub Bot commented on THRIFT-2628: ---------------------------------------- GitHub user talentdeficit opened a pull request: https://github.com/apache/thrift/pull/228 THRIFT-2628: struct member name conflicts due to lowercased names (erlang) You can merge this pull request into a Git repository by running: $ git pull https://github.com/talentdeficit/thrift thrift-2628 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/228.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 #228 ---- commit ab0c4bd34816b3262d8bc96e5e22e915ab8fd19f Author: alisdair sullivan <alisdairsulli...@yahoo.ca> Date: 2014-09-02T23:28:24Z THRIFT-2689: struct names that differ only in capitalization of first character generate broken erlang code alter generation so that accurate names are retained in generated code commit fd7a870ff6c6e18ad5e2e200a447b164976d2a8f Author: alisdair sullivan <alisdairsulli...@yahoo.ca> Date: 2014-09-24T06:04:38Z THRIFT-2628/2689 client: erlang patch: talentdeficit (alisdair sullivan) generates idiomatic erlang names for structs, constants, module names and records adds the 'legacynames' generator option to preserve pre-0.9.2 naming conventions ---- > erlang: struct member name conflicts due to lowercased names > ------------------------------------------------------------ > > Key: THRIFT-2628 > URL: https://issues.apache.org/jira/browse/THRIFT-2628 > Project: Thrift > Issue Type: Bug > Components: Erlang - Compiler, Erlang - Library > Reporter: alisdair sullivan > Assignee: alisdair sullivan > Labels: erlang > Fix For: 0.9.2 > > > the erlang backend generates records to represent structs. instead of the > unique sequential id they use the struct field name as the record keys. > records in erlang do not support repeated keys so generated erlang modules do > not compile > the most obvious fix is to refuse to generate code from structs with repeated > keys but this means the erlang backend is not capable of handling all valid > structs > the easiest fix is to switch structs to use the unique sequential ids as the > keys of the record but this breaks backwards compatibility and probably > necessitates generating helper functions to retrieve fields by name > also possible is switching to an erlang data structure that supports repeated > keys but this would also require breaking backwards compatibility -- This message was sent by Atlassian JIRA (v6.3.4#6332)