http://d.puremagic.com/issues/show_bug.cgi?id=2943
Don <clugd...@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |clugd...@yahoo.com.au --- Comment #6 from Don <clugd...@yahoo.com.au> 2010-10-06 14:39:59 PDT --- Very simple. This is a special case where alias this should be ignored. PATCH: opover.c, BinExp::op_overload(), line 684 and 698. Also fixes bug 4641. #if DMDV2 // Try alias this on first operand - if (ad1 && ad1->aliasthis) + if (ad1 && ad1->aliasthis && !(op == TOKassign && ad2 && ad1 == ad2)) { /* Rewrite (e1 op e2) as: * (e1.aliasthis op e2) */ // Try alias this on second operand - if (ad2 && ad2->aliasthis) + if (ad2 && ad2->aliasthis && !(op == TOKassign && ad1 && ad1 == ad2)) { /* Rewrite (e1 op e2) as: * (e1 op e2.aliasthis) */ ============ TEST FOR TEST SUITE struct Foo2943 { int a; int b; alias b this; } void main() { Foo2943 foo, foo2; foo.a = 1; foo.b = 2; foo2.a = 3; foo2.b = 4; foo2 = foo; assert(foo2.a == foo.a); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------