-
Notifications
You must be signed in to change notification settings - Fork 181
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
Array of channels causes internal error #1726
Comments
We should change this to return a better error, but channel arrays are intended to be used
Both restrictions are violated by the example. Here's a modified version I would expect to work:
If used in a loop, it needs to be an unroll_for! loop, which expands to a series of copies of the loop body in which the indices are constexpr. |
Thanks for clarification @richmckeever. I tried to build the modified version and I got another error:
There might be something wrong with using channel arrays inside next (state: u1) {
let (tok_0, val_0) = recv_if(join(), in_r[0], state == u1:0, u32:0);
let (tok_1, val_1) = recv_if(join(), in_r[1], state == u1:1, u32:0);
let tok = join(tok_0, tok_1);
let val = if state == u1:0 { val_0 } else { val_1 };
send(tok, out_s, val);
state + u1:1
} |
Describe the bug
Creating an array of channels and then using it in loop causes internal error.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The target is built with no errors.
Environment (this can be helpful for troubleshooting):
The text was updated successfully, but these errors were encountered: