You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2014/10/02 09:36:34 UTC

[jira] [Commented] (THRIFT-2628) erlang: struct member name conflicts due to lowercased names

    [ https://issues.apache.org/jira/browse/THRIFT-2628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14156182#comment-14156182 ] 

Hudson commented on THRIFT-2628:
--------------------------------

FAILURE: Integrated in Thrift-precommit #4 (See [https://builds.apache.org/job/Thrift-precommit/4/])
THRIFT-2628/2689 (alisdairsullivan: rev 3c853db9b22f239f01ad23d20dbd4a099c9463ad)
* test/erl/Makefile.am
* lib/erl/test/test_thrift_1151.erl
* compiler/cpp/src/generate/t_erl_generator.cc
* test/erl/src/name_conflict_test.erl
* test/erl/src/nameConflictTest_test.erl
* test/erl/src/thrift_test.app.src
* lib/erl/test/test_membuffer.erl
* lib/erl/test/test_client.erl
* lib/erl/test/test_server.erl
* compiler/cpp/src/generate/t_generator.h
* test/erl/src/thrift_test_test.erl
* test/erl/src/legacy_names_test.erl
* lib/erl/test/test_disklog.erl
* test/erl/LegacyNames.thrift
* contrib/Vagrantfile


> 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)