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

Jens Geyer edited comment on THRIFT-2063 at 7/30/13 1:13 AM:
-------------------------------------------------------------

{quote}
In my opinion this should be accepted as a constraint to avoid the complexity 
cost of maintaining our own map/set/list implementations.
{quote}

While I agree with the effort, I have some doubts if a half-baked library 
implementation is really a suitable goal, with regard to both Thrift and the Go 
language itself. 

Just an idea, as an discussion starter: Could some/most/all of the code 
required to do this

{quote}
The comparison operators == and != must be fully defined for operands of the 
key type; thus the key type must not be a function, map, or slice. If the key 
type is an interface type, these comparison operators must be defined for the 
dynamic key values; failure will cause a run-time panic. 
{quote}

be generated as well? 
                
      was (Author: jensg):
    {quote}
In my opinion this should be accepted as a constraint to avoid the complexity 
cost of maintaining our own map/set/list implementations.
{quote}

While I agree with the effort, I have some doubts if a half-baked library 
implementation will be of much use. Just an idea, as an discussion starter: 
Could some/most/all of the code required to do this

{quote}
The comparison operators == and != must be fully defined for operands of the 
key type; thus the key type must not be a function, map, or slice. If the key 
type is an interface type, these comparison operators must be defined for the 
dynamic key values; failure will cause a run-time panic. 
{quote}

be generated as well? 
                  
> Go compiler cannot create code for maps with a map as key
> ---------------------------------------------------------
>
>                 Key: THRIFT-2063
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2063
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>            Reporter: Remo Hertig
>
> trying to generate code for ThriftTest leads to:
> {code}
> ../../compiler/cpp/thrift --gen go ../ThriftTest.thrift 
> [WARNING:/tbHD/Home/nairboon/dev/thrift/test/ThriftTest.thrift:41] No 
> generator named 'noexist' could be found!
> [WARNING:/tbHD/Home/nairboon/dev/thrift/test/ThriftTest.thrift:42] cpp 
> generator does not accept 'noexist' as sub-namespace!
> Error: Cannot produce a valid type for a Go map key: map[int32]bool - 
> aborting.{code}
> the affected struct seems to be #3: 
> {code}
> struct CrazyNesting {
>   1: string string_field,
>   2: optional set<Insanity> set_field,
>   3: required list< map<set<i32>,map<i32,set<list<map<Insanity,string>>>>>> 
> list_field,
>   4: binary binary_field
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to