You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Matt Sanders (JIRA)" <ji...@apache.org> on 2016/01/14 17:00:42 UTC

[jira] [Created] (THRIFT-3553) Go Map value type is dependent on order of entity definitions

Matt Sanders created THRIFT-3553:
------------------------------------

             Summary: Go Map value type is dependent on order of entity definitions
                 Key: THRIFT-3553
                 URL: https://issues.apache.org/jira/browse/THRIFT-3553
             Project: Thrift
          Issue Type: Bug
          Components: Go - Compiler
            Reporter: Matt Sanders
            Priority: Minor


Deserialization code of map type properties will generate a compilation error if the type definition of the value appears after the definition of the map where it is used.

{code:title=Error Example}
struct TestsResponse {
	1: map<string, Test> tests
}

struct Test {
	1: string id
	2: string name
}
{code}

Compilation Error
{quote}
ttypes.go:83: cannot use _val1 (type *Test) as type Test in assignment
{quote}

In the example moving the definition of 'Test' to appear before 'TestResponse' avoids the compilation error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)