You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Tom Deering (JIRA)" <ji...@apache.org> on 2015/12/14 23:43:46 UTC
[jira] [Updated] (THRIFT-3491) Invalid Go Code From Service
Signatures With Typedef'd Structs
[ https://issues.apache.org/jira/browse/THRIFT-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tom Deering updated THRIFT-3491:
--------------------------------
Description:
Thrift 0.9.3 produces invalid Go code when service definitions are written in terms of type-deffed structs.
bug.thrift
{code}
namespace go bug
struct Foo {
1:string s,
}
typedef Foo Bar
service BarService {
Bar getBar()
}
{code}
Attempting to compile the Go code that Thrift outputs yields the following errors.
{code}
bug/barservice.go:192: cannot use retval (type Bar) as type *Bar in assignment
bug/barservice.go:323: cannot use Foo literal (type *Foo) as type *Bar in assignment
bug/barservice.go:324: p.Success.Read undefined (type *Bar has no field or method Read)
bug/barservice.go:351: p.Success.Write undefined (type *Bar has no field or method Write)
{code}
Inspecting the Go code, it appears that the Go compiler is telling the truth.
was:
Thrift 0.9.3 produces invalid Go code when service definitions are written in terms of type-deffed structs.
bug.thrift
{code}
namespace go bug
struct Foo {
1:string s,
}
typedef Foo Bar
service BarService {
Bar getBar()
}
{code}
Attempting to compile the Go code that Thrift outputs yields the following errors.
{code}
bug/barservice.go:192: cannot use retval (type Bar) as type *Bar in assignment
bug/barservice.go:323: cannot use Foo literal (type *Foo) as type *Bar in assignment
/bug/barservice.go:324: p.Success.Read undefined (type *Bar has no field or method Read)
bug/barservice.go:351: p.Success.Write undefined (type *Bar has no field or method Write)
{code}
Inspecting the Go code, it appears that the Go compiler is telling the truth.
> Invalid Go Code From Service Signatures With Typedef'd Structs
> --------------------------------------------------------------
>
> Key: THRIFT-3491
> URL: https://issues.apache.org/jira/browse/THRIFT-3491
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Affects Versions: 0.9.3
> Reporter: Tom Deering
>
> Thrift 0.9.3 produces invalid Go code when service definitions are written in terms of type-deffed structs.
> bug.thrift
> {code}
> namespace go bug
> struct Foo {
> 1:string s,
> }
> typedef Foo Bar
> service BarService {
> Bar getBar()
> }
> {code}
> Attempting to compile the Go code that Thrift outputs yields the following errors.
> {code}
> bug/barservice.go:192: cannot use retval (type Bar) as type *Bar in assignment
> bug/barservice.go:323: cannot use Foo literal (type *Foo) as type *Bar in assignment
> bug/barservice.go:324: p.Success.Read undefined (type *Bar has no field or method Read)
> bug/barservice.go:351: p.Success.Write undefined (type *Bar has no field or method Write)
> {code}
> Inspecting the Go code, it appears that the Go compiler is telling the truth.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)