class Foo
{
private int _bar;
int bar
{
get { return _bar; }
set { _bar = value; }
}
}
void Main()
{
Foo x, y;
// You can't do this
x.bar = y.bar = 10;
// You have to do this instead:
x.bar = 10;
y.bar = 10;
}
Complains that "No matching signatures to 'Foo::set_bar(void)'". Instead, you have to set them individually.If I do this:
int get_bar() { return _bar; }
int set_var(int v) { _bar = v; return _bar; }
It says "The property has no set accessor".Not sure if this is a bug or a missing feature though.