[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct

2018-06-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18934

Steven Schveighoffer  changed:

   What|Removed |Added

   Keywords||pull, rejects-valid
   Hardware|x86_64  |All
 OS|Linux   |All

--- Comment #3 from Steven Schveighoffer  ---
PR: https://github.com/dlang/phobos/pull/6544

--


[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct

2018-06-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18934

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com
   Assignee|nob...@puremagic.com|schvei...@yahoo.com

--- Comment #2 from Steven Schveighoffer  ---
The issue comes from std.variant.Variant checking the wrong thing when it comes
to constancy.

A smaller test case:

import std.variant;
import std.stdio;

struct S
{
const int x;
}
void main()
{
Variant v = S(1);
writeln(v.get!S); // error
}

The issue is with the check inside std.variant to see if you can copy the given
type to the requested type. The type matches, but the copy would normally fail
because you can't overwrite const data.

However, in the case of v.get!S, it's a move and not a copy. The check should
be on moving the data, not copying. I have tested a fix, will submit a PR.

--


[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct

2018-06-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18934

--- Comment #1 from Russel Winder  ---
Created attachment 1699
  --> https://issues.dlang.org/attachment.cgi?id=1699=edit
Code exhibiting the error

--


[Issue 18934] std.concurrency receive throws assertion failure is message is a struct of struct

2018-06-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18934

Russel Winder  changed:

   What|Removed |Added

Summary|std.cocurrency receive  |std.concurrency receive
   |throws assertion failure is |throws assertion failure is
   |message is a struct of  |message is a struct of
   |struct  |struct

--


[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct

2018-06-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18934

Russel Winder  changed:

   What|Removed |Added

Summary|std.concurrency receive |std.concurrency receive
   |throws assertion failure is |throws assertion failure if
   |message is a struct of  |message is a struct of
   |struct  |struct

--