https://issues.dlang.org/show_bug.cgi?id=15004
Issue ID: 15004
Summary: std.concurrency fails to compile when sending static
array larger 32 byte
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
http://forum.dlang.org/thread/[email protected]
Sending a static array larger than 32 Byte fails with the error (dmd 2.068,
same with 2.066 based ldc, so probably no recent regression):
dmd/phobos/std/variant.d(633): Error: new can only create structs, dynamic
arrays or class objects, not int[9]'s
dmd/phobos/std/variant.d(344): Error: new can only create structs, dynamic
arrays or class objects, not int[9]'s
[...]
I tested this string[n], int[n] and byte[n] - if the array is 32 Byte or
smaller, it works fine.
As the limit is the same, this is perhaps related to
https://issues.dlang.org/show_bug.cgi?id=10740 (although the error message is
different)
Test programm:
import std.concurrency;
import std.stdio;
void fun() {
receive((byte[33] data) { writeln(data);});
}
void main() {
byte[33] data;
pragma(msg, data.sizeof);
auto tid = spawn(&fun);
send(tid, data);
}
--