fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Property setters do not return the property value #368

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In .NET, property setters return the property value. E.g.:

void RunTest()
{
  MyClass a, b;
  a.MyProperty = b.MyProperty = 5;
}

This bit of code translates correctly, because SharpKit wraps the first 
assignment into an anonymous function that returns the value.

However, this approach fails in slightly more complicated cases:

void DoStuff(int i) { }
void RunTest()
{
  MyClass a;
  DoStuff(a.MyProperty = 5);
}

In the above, DoStuff will be called on 5 in .NET, but it will be called on 
undefined after SharpKit translation.

Original issue reported on code.google.com by filp...@tin.it on 19 Sep 2014 at 8:36