You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Emir Habul (JIRA)" <ji...@apache.org> on 2013/08/03 09:07:49 UTC

[jira] [Created] (THRIFT-2112) Error in Go generator when using typedefs in map keys

Emir Habul created THRIFT-2112:
----------------------------------

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


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