Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.4
-
None
Description
The thrift IDL specifies that a field can be a assigned a default ConstValue, which can be an identifier, possibly a struct. However, the compiler rejects this input with the error: type error: const was declared as struct/xception.
For this example input:
struct A {
1: string name = ""
}
const A DEFAULT_A = {}
struct B {
1: A a = DEFAULT_A
}
The expected output would be something like (in Java):
public class B { public B() { this.a = new A(Constants.DEFAULT_A); } }
Note that a copy of DEFAULT_A is used instead of the DEFAULT_A instance itself.