Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.parallelism giving inscrutable error messages #10155

Closed
dlangBugzillaToGithub opened this issue Jan 12, 2016 · 1 comment
Closed

std.parallelism giving inscrutable error messages #10155

dlangBugzillaToGithub opened this issue Jan 12, 2016 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

deadalnix (@deadalnix) reported this on 2016-01-12T13:34:08Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=15558

Description

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.
@thewilsonator thewilsonator removed Arch:x86 Issues specific to x86 P4 OS:Mac OS Issues Specific to Mac OS labels Dec 5, 2024
@thewilsonator
Copy link
Contributor

This now gives

/dlang/dmd/linux/bin64/../../src/phobos/std/parallelism.d(2179): Error: struct `onlineapp.Host` is not copyable because it has a disabled postblit
onlineapp.d(11): Error: template instance `std.parallelism.TaskPool.map!(function Host(uint a) pure nothrow @nogc @safe => Host()).map!(uint[])` error instantiating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants