Yi Zheng created THRIFT-4090:
--------------------------------
Summary: compile error with array of alias in golang
Key: THRIFT-4090
URL: https://issues.apache.org/jira/browse/THRIFT-4090
Project: Thrift
Issue Type: Question
Components: Go - Compiler
Affects Versions: 0.10.0
Environment: mac sierra latest
Reporter: Yi Zheng
Fix For: 0.9.3
This case works well under 0.9.3 but not in 0.10.0
-aaa.thrift
typedef i64 SomeStruct
-bbb.thrift
include "aaa.thrift"
struct AnotherStruct {
1: required list<aaa.SomeStruct> another_struct;
}
==========================================
I read the compiled code, there will be code in "ReadFieldX" function like:
for i := 0; i < size; i ++ {
var _elem0 int64
if v, err := iprot.ReadI64(); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem0 = v
}
p.EswLinkList = append(p.EswLinkList, _elem0) // <= compilation error
here!
}
However, it is not allowed to append a int64 to an array of int64's alias.
But this works in 0.9.3, I don't know whether this is an expected behavior?
Thanks very much!
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)