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

createArray fails to resolve with an unhelpful message with non-nilable element types #25966

Open
e-kayrakli opened this issue Sep 19, 2024 · 1 comment

Comments

@e-kayrakli
Copy link
Contributor

use BlockDist;

class C {}

var Arr = blockDist.createArray(1..10, unmanaged C);

writeln(Arr);

produces

$CHPL_HOME/modules/dists/BlockDist.chpl:1016: error: cannot default-initialize the array A because it has a non-nilable element type 'unmanaged C'

this is all about the internal implementation. createArray functions should check for the element type and produce a better error message for unsupported types. And/or we should try to support them.

@bradcray
Copy link
Member

Definitely agree with the "better error message" request. I'm not seeing how we could support this call though? (specifically, I don't think we should create objects for the user).

Did we ever create a createArray() overload that also took an initial value (or collection of initial values) for the elements? That'd be a different way to support these element types.

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