You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2015/05/08 22:26:01 UTC
[jira] [Commented] (THRIFT-3128) Go generated code produces name
collisions between services
[ https://issues.apache.org/jira/browse/THRIFT-3128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14535427#comment-14535427 ]
Hudson commented on THRIFT-3128:
--------------------------------
SUCCESS: Integrated in Thrift #1537 (See [https://builds.apache.org/job/Thrift/1537/])
THRIFT-3128 Go generated code produces name collisions between services (jensg: rev dfc22ad2059312018777265af0b8684f0173b9dc)
* lib/go/test/NamesTest.thrift
* compiler/cpp/src/generate/t_go_generator.cc
> Go generated code produces name collisions between services
> -----------------------------------------------------------
>
> Key: THRIFT-3128
> URL: https://issues.apache.org/jira/browse/THRIFT-3128
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Affects Versions: 0.9.2
> Environment: Built from git, confirmed missing prefixes in t_go_generator.cc
> Reporter: Adam Beberg
> Assignee: Adam Beberg
> Fix For: 0.9.3
>
> Attachments: THRIFT-3128-Go-name-collisions.patch
>
>
> =====
> Thrift file to produce problem:
> =====
> namespace go BreakGo
> service S1 {
> i32 Ping(1:i32 i)
> }
> service S2 {
> i32 Ping(1:i32 i)
> }
> =====
> Errors:
> =====
> ../BreakGo/s2.go:222: PingArgs redeclared in this block
> previous declaration at ../BreakGo/s1.go:222
> ../BreakGo/s2.go:226: NewPingArgs redeclared in this block
> previous declaration at ../BreakGo/s1.go:226
> ../BreakGo/s2.go:230: (*PingArgs).GetI redeclared in this block
> previous declaration at ../BreakGo/s1.go:230
> ../BreakGo/s2.go:233: (*PingArgs).Read redeclared in this block
> previous declaration at ../BreakGo/s1.go:233
> ../BreakGo/s2.go:266: (*PingArgs).ReadField1 redeclared in this block
> previous declaration at ../BreakGo/s1.go:266
> ../BreakGo/s2.go:275: (*PingArgs).Write redeclared in this block
> previous declaration at ../BreakGo/s1.go:275
> ../BreakGo/s2.go:291: (*PingArgs).writeField1 redeclared in this block
> previous declaration at ../BreakGo/s1.go:291
> ../BreakGo/s2.go:304: (*PingArgs).String redeclared in this block
> previous declaration at ../BreakGo/s1.go:304
> ../BreakGo/s2.go:313: PingResult redeclared in this block
> previous declaration at ../BreakGo/s1.go:313
> ../BreakGo/s2.go:317: NewPingResult redeclared in this block
> previous declaration at ../BreakGo/s1.go:317
> ../BreakGo/s2.go:317: too many errors
> =====
> Solution: Use the service name as a prefix for the *Args and *Result helper structs, to generate S1PingArgs, S2PingArgs, S1PingResult, etc.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)