Skip to content

add support for using const ty param as array size #1120

@sbillig

Description

@sbillig

for example:

struct A<const N: usize> {
  inner: [u8; N] // error
}
struct B<const N: usize> {
  inner: A<N> // this is fine
}
error[3-0015]: the expression is not supported yet in a const type context
  ┌─ foo.fe:2:15
  │
2 │   inner: [u8; N]
  │               ^ only literal expression is supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions