Skip to content

Unable to create empty array #261

@robinhundt

Description

@robinhundt
fn main() -> bool {
    let a: [(usize); 0] = [];
    let b: [(usize); 0] = [];
    for _ in join(a, b) {}
    true
}

fails with


Parse error on line 2:28.
Expected an expression:
       | fn main() -> bool {
   2 > |     let a: [(usize); 0] = [];
     > |                            ^
       |     let b: [(usize); 0] = [];

Expected

It should be possible to create an empty array, even if that is not useful for most programs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions