Closed hayes closed 5 years ago
~It looks like this is not an issue with strictUnions which is likely what I will try to migrate to~ I spoke too soon. I believe that strictUnions will encounter the same issue, but the way the default value is initialized is slightly different
@hayes This shouldn't be a hard fix. I'll get something published by Monday, will try to get it done today.
awesome! thank you for the quick response.
I am not 100% sure what the correct behavior is, and just came across this on one of our schemas.
The unions looks something like:
The generated code (for
thrift-server
) will look something like:The issue here is that the union will always set isNull and if a value is passed boolValue, the constructor will end up with both props set.
My initial thought on this was that you should only set initializer values if
_fieldSet < 1