Reply to Frits,

BCS wrote:

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();
struct A {
int i;
void Foo() { i = 42; }
}
alias A B;

The first case will set a.i to 42, the second will set b.i.


I wasn't looking for side effect cases  but I guess that is correct.

And with opAssign + different struct types they'd be calling two
completely different Foo()s.


Oh, forgot opAssign (darn)

Then there's array types + global function Foo(ref A), union types
(similar to struct types), class types + static Foo()s (different ones
for A and B), ...


ok looks like to much of a mess to make it work


Reply via email to