Have you checked that across languages? IIRC __isset is never set for defaults as they are not sent over the wire. Either way, the behaviour should be consistent and compatible. Please verify that.
Thanks, Jens ________________________________ Von: Jin Feng (JIRA) Gesendet: 22.02.2013 03:29 An: [email protected] Betreff: [jira] [Commented] (THRIFT-1026) C# default value code generation problem [ https://issues.apache.org/jira/browse/THRIFT-1026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13583832#comment-13583832 ] Jin Feng commented on THRIFT-1026: ---------------------------------- Filed a new one THRIFT-1862. Thx > C# default value code generation problem > ---------------------------------------- > > Key: THRIFT-1026 > URL: https://issues.apache.org/jira/browse/THRIFT-1026 > Project: Thrift > Issue Type: Bug > Components: C# - Compiler > Affects Versions: 0.5 > Environment: Windows, Mac > Reporter: William Blinn > > I have a thrift file that looks like this: > {code} > // Time stamp with a timezone specification for normalization. > struct DateTimeZone > { > 1: i64 ticks, > 2: optional string timeZone = "UTC", > } > {code} > When I generate C#, it produces code like this: > {code} > [Serializable] > public partial class DateTimeZone : TBase > { > private long _ticks; > private string _timeZone; > public long Ticks > { > get > { > return _ticks; > } > set > { > __isset.ticks = true; > this._ticks = value; > } > } > public string TimeZone > { > get > { > return _timeZone; > } > set > { > __isset.timeZone = true; > this._timeZone = value; > } > } > public Isset __isset; > [Serializable] > public struct Isset { > public bool ticks; > public bool timeZone; > } > public DateTimeZone() { > this.timeZone = "UTC"; > } > ... > {code} > The constructor, which sets the default value should be this.TimeZone = "UTC" > because the property is TimeZone, not timeZone. The constructor should set > the property rather than the field so that __isset is marked properly. > The compile error I get when I try to compile the code that thrift generates > is like this: > {code} > [csc] d:\code\Thrift\Generated\DateTimeZone.cs(59,12): error CS1061: > 'Thrift.Generated.DateTimeZone' does not contain a definition for 'timeZone' > and no extension method 'timeZone' accepting a first argument of type > 'Thrift.Generated.DateTimeZone' could be found (are you missing a using > directive or an assembly reference?) > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
