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

[Unimplemented Feature]: Heap copy initialization between instantiations with different parSafe settings #24965

Open
lydia-duncan opened this issue May 1, 2024 · 0 comments

Comments

@lydia-duncan
Copy link
Member

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

1 participant