chapel
chapel copied to clipboard
[Unimplemented Feature]: Heap copy initialization between instantiations with different parSafe settings
Summary of Feature
Description: The list, set, and map types all support copy initialization when different parSafe settings are involved (albeit, with a warning for list today and hopefully soon for set and map). But trying the same thing today with heap results in error messages about not being able to find a copy initializer for that combination. Since we would like to unify our interfaces for collection types where reasonable, it seems plausible that we'd want to support this.
That said, parSafe
on the other collection types is unstable because we'd prefer to implement separate parallel safe versions of the types instead of relying on the field. It's probably not worth investing too much time into things related to heap's parSafe setting as well, given that context.
I'm mostly recording this so we don't forget to check copy initialization compatibility when we get around to stabilizing the Heap module.
Is this a blocking issue with no known work-arounds? It's inconvenient and the rules around when copy-initialization is used can be a bit mysterious, but it's probably possible to work around
Code Sample
use Heap;
var x = new heap(int); // defaults to parSafe = false
x.push(1);
x.push(2);
writeln("x: ", x.type:string);
var a: heap(parSafe=true, ?) = x;
writeln("a: ", a.type: string);