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

Restrict const generic types #1303

Open
Tracked by #1351
CohenArthur opened this issue Jun 8, 2022 · 1 comment
Open
Tracked by #1351

Restrict const generic types #1303

CohenArthur opened this issue Jun 8, 2022 · 1 comment

Comments

@CohenArthur
Copy link
Member

Per the documentation on const generics:

The only allowed types of const parameters are u8, u16, u32, u64, u128, usize i8, i16, i32, i64, i128, isize, char and bool.

Afterwards, we can look into more complex types gated behind the adt_const_params feature

@CohenArthur
Copy link
Member Author

I'm unsure as to whether this should live in our typechecker or our const checker. One one hand, it makes sense to check that during typechecking, on the other hand it could be quite a large amount of code + we'd need to handle the feature properly. I think it would be fine to put that as part of the const checker, and lookup types using the type context (and disable that error if the feature is enabled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants