[Issue 9122] std.concurrency send() fails with multiple arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 14 20:07:58 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9122


Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu


--- Comment #6 from Martin Nowak <code at dawg.eu> 2013-05-14 20:07:55 PDT ---
(In reply to comment #5)
> The Variant is defined like:
> alias VariantN!(maxSize!(creal, char[], void delegate())) Variant;
> so it has already a fixed size. The constructor can cope with the bigger size
> and will adjust, but the opAssign does not.

OpAssign moves the assigned value onto the heap so this is not the problem.
https://github.com/D-Programming-Language/phobos/blob/c319b1578f28e00124d2f0c2a492790d01ca5159/std/variant.d#L545

Also the following code works correctly for me on 2.062.
---
import std.variant, std.stdio;

struct S { int p1, p2, p3, p4, p5, p6; }

void main()
{
    Variant v1 = S(1, 2, 3, 4, 5, 6);
    writeln(v1);
    Variant v2;
    writeln(v2);
    v2 = v1; // assert
    writeln(v2);
}
---

The bug seems to be in the handler for OpID.copyOut.

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


More information about the Digitalmars-d-bugs mailing list