Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.18.0
-
None
Description
This is a bug introduced by the fix of THRIFT-5601.
Given this thrift file:
struct Bar { 1: optional Foo bar } struct Foo { 1: optional i64 foo }
0.18.0 with b39370ec3bc96d2 reverted will generate the following go code (expected):
... var Bar_Bar_DEFAULT *Foo func (p *Bar) GetBar() *Foo { if !p.IsSetBar() { return Bar_Bar_DEFAULT } return p.Bar } ...
while 0.18.0 generates:
... var Bar_Bar_DEFAULT Foo func (p *Bar) GetBar() Foo { if !p.IsSetBar() { return Bar_Bar_DEFAULT } return *p.Bar } ...
This makes usages like bar.GetBar().GetFoo() no longer compiles because GetBar now returns non-pointer type.
Attachments
Issue Links
- causes
-
THRIFT-5823 Fix illegal uses of exceptions as normal struct type
- Resolved
- is broken by
-
THRIFT-5601 Typedef after first use causes incorrect go code
- Reopened
- links to