Classes defined with a member variable "value" produces broken code in C#
-------------------------------------------------------------------------

                 Key: THRIFT-384
                 URL: https://issues.apache.org/jira/browse/THRIFT-384
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (C#)
            Reporter: Richard Lee


When a Class definition has a member called "value", the C# generator produces 
the following broken code:

  public T Value
  {
    get
    {
      return value;
    }
    set
    {
      __isset.value = true;
      value = value;
    }
  }


The broken part here is in the setter where "value" which is a keyword meaning 
the left hand side of an assignment gets assigned to itself.  Really what needs 
to be generated for the setter is:

    set
    {
      __isset.value = true;
      this.value = value;
    }


The obvious easy workaround is to not have a member variable named "value"... 
but in my case, the .thrift file is from a 3rd party (in this case, the 
Hbase.thrift) so that's not doable. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to