Note that there are some explanatory texts on larger screens.

plurals
  1. POError while compiling protobuf-net generated codecode
    primarykey
    data
    text
    <p>Have funny error in protobuf-net generated code. .proto definition file contains field named "value" for an object. What protogen.exe generated for that value with -p:detectMissing option:</p> <pre><code> private int? _value; [global::ProtoBuf.ProtoMember(50, IsRequired = false, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.Xml.Serialization.XmlElement(@"value", Order = 50)] public int value { get { return _value ?? default(int); } set { _value = value; } } [global::System.Xml.Serialization.XmlIgnore] [global::System.ComponentModel.Browsable(false)] public bool valueSpecified { get { return _value != null; } set { if (value == (_value == null)) _value = value ? value : (int?)null; } } private bool ShouldSerializevalue() { return valueSpecified; } private void Resetvalue() { valueSpecified = false; } </code></pre> <p>Compiler produces an error thinking that <strong>value</strong> is a keyword but not class property:</p> <blockquote> <p>Type of conditional expression cannot be determined because there is no implicit conversion between 'bool' and 'int?'</p> </blockquote> <p>Made workaround manually altering generated code:</p> <pre><code>public int valueWorkaround { get { return _value ?? default(int); } } public bool valueSpecified { get { return _value != null; } set { if (value == (_value == null)) _value = value ? valueWorkaround : (int?)null; } } </code></pre> <p>However probably it makes sense to fix code generation also?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload