Are there any cases where the following cases both compile but are not 
identical?

A a;
B b;

a = b;
a.Foo();

//// and

A a;
B b;

a = b;
b.Foo();

The reason I ask is I'm wondering if making the type (and value) of an assignment expression the right hand side rather than the left hand side would silently break code. It would be handy for cases like this because it avoids the need for a temp variable:

class C { }
class D : C { int i();}

D newD();

C c;

void main()
{
  (c = newD()).i();
}


Reply via email to