D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15004 - std.concurrency fails to compile when sending static array larger 32 byte
Summary: std.concurrency fails to compile when sending static array larger 32 byte
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-02 18:54 UTC by secondaryAccount
Modified: 2019-12-14 09:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description secondaryAccount 2015-09-02 18:54:05 UTC
http://forum.dlang.org/thread/zhtmthkcijzutkwvyfvi@forum.dlang.org

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);
}