noir icon indicating copy to clipboard operation
noir copied to clipboard

Calling `map` on a slice panics

Open michaeljklein opened this issue 1 year ago • 3 comments

Aim

Allow calling map on a slice

Expected Behavior

The file to compile successfully and return nothing

Bug

Compiler panics

To Reproduce

fn main() { 
    let x: [Field] = [3; 4];
    let _ = x.map(|y| y);
}

returns:

The application panicked (crashed).
Message:  Length of array is unknown when evaluating numeric generic
Location: compiler/noirc_frontend/src/monomorphization/mod.rs:461

Installation Method

Compiled from source

Nargo Version

nargo version = 0.23.0 noirc version = 0.23.0+5a9e434c51549d889e2538111393cc89030bb39c (git version hash: 3af2a89826f7d9b6dcd1782b8b38417c64065293, is dirty: true)

Additional Context

No response

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

michaeljklein avatar Jan 31 '24 21:01 michaeljklein

Is this issue related (https://github.com/noir-lang/noir/issues/2540)? @michaeljklein Could you check if it is resolved by your work?

vezenovm avatar Feb 05 '24 15:02 vezenovm

@vezenovm yes that issue has the same underlying cause as this one

jfecher avatar Feb 05 '24 15:02 jfecher

This will no longer panic once https://github.com/noir-lang/noir/pull/4408 is merged but is still active.

TomAFrench avatar Feb 23 '24 17:02 TomAFrench