I'm pretty sure this is a bug, but the error makes me think I'm somehow using immutable incorrectly:<div><br></div><div><div><div>import std.parallelism;</div><div><br></div><div>class Test {</div><div>}</div><div>

<br></div><div>void doSomething(immutable(Test) test) {</div><div>}</div><div><br></div><div>void main() {</div><div>        immutable(Test) test = new immutable(Test)();</div><div>        taskPool().put(task!(doSomething)(test));</div>

<div>}</div></div></div><div><br></div><div><br></div><div>compiler output:</div><div><div>Error: can only initialize const member __args_field_0 inside constructor</div><div>Error: this is not mutable</div><div>/usr/include/d2/4.6.0/std/parallelism.d:734: Error: template instance std.parallelism.Task!(doSomething,immutable(Test)) error instantiating</div>

<div>tasktest.d:11:        instantiated from here: task!(doSomething,immutable(Test))</div></div><div><br></div>