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

[Bug]: Cannot create a constant task private class #26017

Open
jabraham17 opened this issue Sep 27, 2024 · 0 comments
Open

[Bug]: Cannot create a constant task private class #26017

jabraham17 opened this issue Sep 27, 2024 · 0 comments

Comments

@jabraham17
Copy link
Member

I found I cannot have a const task private variable that is a managed class (i.e. the destructor is invoked for me)

class C { }

forall 1..10 with (const c = new C()) { } // error: const actual is passed to 'ref' formal 'x' of chpl__autoDestroy()

However, I can make a var task private class and I can make a const task private record

class C { }
record R { }

forall 1..10 with (var c = new C()) { } // this is fine
forall 1..10 with (const r = new R()) { } // this is also fine

I think this should be valid code, I see no reason a const task private class should not be allowed while a const task private record is.

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