Issue 15558 - std.parallelism giving inscrutable error messages
Summary: std.parallelism giving inscrutable error messages
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-12 13:34 UTC by deadalnix
Modified: 2024-12-01 16:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description deadalnix 2016-01-12 13:34:08 UTC
struct Host {
	@disable this(this);
}

void main() {
	uint[] arr;
	
	import std.parallelism;
	auto hostmap = taskPool.map!(function Host(uint a) {
		return Host.init;
	})(arr);
}


Gives me:

/Library/D/dmd/src/phobos/std/parallelism.d(1677): Error: cannot interpret (uint[], ulong, Host[]) at compile time
/Library/D/dmd/src/phobos/std/parallelism.d(1677): Error: static assert  __error
/Library/D/dmd/src/phobos/std/parallelism.d(1996):        instantiated from here: amap!(uint[], ulong, Host[])
fail.d(11):        instantiated from here: map!(uint[])

Turns out the @disable this(this); is key in triggering the error.
Comment 1 dlangBugzillaToGithub 2024-12-01 16:25:47 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10155

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB