Skip to content

Returning a slice from main crashes the compiler #9483

@asterite

Description

@asterite

Aim

This code:

fn main() -> pub [Field] {
    &[1, 2, 3]
}

leads to this error:

The application panicked (crashed).
Message:  not implemented: ICE: cannot fetch flattened slice size
Location: compiler/noirc_evaluator/src/ssa/ir/types.rs:244

Expected Behavior

The program should likely not compile. Similar to how we give an error if unsized types are used as inputs to the program, unsized types should not be allowed in outputs.

Bug

The compiler crashes.

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions