You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "alisdair sullivan (JIRA)" <ji...@apache.org> on 2014/07/15 07:12:04 UTC

[jira] [Updated] (THRIFT-2628) erlang backend doesn't support repeated names

     [ https://issues.apache.org/jira/browse/THRIFT-2628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alisdair sullivan updated THRIFT-2628:
--------------------------------------

    Description: 
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

  was:
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

also possible

possible fixes are to refuse to generate code from structs with repeated keys, switch generated records to use the unique sequential ids as the key or switch to an erlang data structure that supports repeated keys (probably a proplist)




> erlang backend doesn't support repeated 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
>              Labels: erlang
>
> 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.2#6252)