Skip to content

indexing into a constant repeat expression yields repeat value #33252

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

Closed
oli-obk opened this issue Apr 28, 2016 · 1 comment
Closed

indexing into a constant repeat expression yields repeat value #33252

oli-obk opened this issue Apr 28, 2016 · 1 comment

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Apr 28, 2016

The following piece of code errors with expected usize value for array length, got repeat. Seems like I ended up forwarding the wrong expression during the computation of a const repeat.

#![feature(const_indexing)]

const X: [usize; 5] = [5; 5];

fn main() {
    let _: [i32; X[0]];
}
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 26, 2017

This works now correctly

@oli-obk oli-obk closed this as completed Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant