[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2943

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.029   |D2

--


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-10-06 Thread d-bugmail
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: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943



--- Comment #4 from Serg Kovrov kovrov+purema...@gmail.com 2010-09-05 
09:16:32 PDT ---
I do. As stated in comment for Bug 3135#c1 - an empty postblit function seem to
workaround the issue..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943



--- Comment #5 from David Simcha dsim...@yahoo.com 2010-09-05 09:52:19 PDT ---
(In reply to comment #3)
 doesn't anyone use alias this?

I mostly don't, but only b/c it's currently so buggy it's not even funny.  I
just looked, I myself have filed at least 5 bug reports on it, 4 of which I
filed within a few days after the first version of DMD with alias this came
out.

IMHO the next big todo after 64 support is to tackle the general extreme
bugginess of alias this and inout, as well as the ref issue w/ opApply (Bug
2443).  These are key features for library writers.  Their bugginess severely
limits their usability, and right now a major criticism of D is lack of
libraries, so supporting library writers is kind of important.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943


Steven Schveighoffer schvei...@yahoo.com changed:

   What|Removed |Added

 CC||schvei...@yahoo.com


--- Comment #3 from Steven Schveighoffer schvei...@yahoo.com 2010-08-31 
05:17:50 PDT ---
upvoted, I can't believe this is been a bug for over a year, doesn't anyone use
alias this?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-08-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 CC||kieron_br...@hotmail.com


--- Comment #2 from David Simcha dsim...@yahoo.com 2010-08-30 15:16:14 PDT ---
*** Issue 4770 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2009-07-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 CC||kovrov+purema...@gmail.com




--- Comment #1 from David Simcha dsim...@yahoo.com  2009-07-05 07:32:52 PDT 
---
*** Issue 3135 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---