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

Jens Geyer resolved THRIFT-2112.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.1

Committed, thanks.

While talking about map keys: Do you have an idea about how THRIFT-2063 could 
be solved in an elegant manner?
                
> Error in Go generator when using typedefs in map keys
> -----------------------------------------------------
>
>                 Key: THRIFT-2112
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2112
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>            Reporter: Emir Habul
>              Labels: newbie, patch
>             Fix For: 0.9.1
>
>         Attachments: thrift-map-keys.patch
>
>
> When following is written in {{.thrift}} input
> {code}
>   typedef i32 MyType
>   typedef map<MyType, i32> ComplexMapType
> {code}
> Generator builds the following:
> {code}
>   type ComplexMapType map[int32]int32
> {code}
> This patch changes the type definition to be
> {code}
>   type ComplexMapType map[MyType]int32
> {code}
> Since, there is really no need to resolve key type from MyType into int32. 
> Compiler would throw error on lines like these:
> {code}
>   complex_var = make(map[MyType]int32, size)
> {code}
> also,
> {code}
>   var _key1 MyType
>   ...
>   complex_var[_key1] = _val2
> {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