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

Calling map on a slice panics #4220

Closed
Tracked by #3363
michaeljklein opened this issue Jan 31, 2024 · 3 comments · Fixed by #4504
Closed
Tracked by #3363

Calling map on a slice panics #4220

michaeljklein opened this issue Jan 31, 2024 · 3 comments · Fixed by #4504
Assignees
Labels
bug Something isn't working

Comments

@michaeljklein
Copy link
Contributor

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: 3af2a89, is dirty: true)

Additional Context

No response

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

@michaeljklein michaeljklein added the bug Something isn't working label Jan 31, 2024
@michaeljklein michaeljklein self-assigned this Jan 31, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 31, 2024
@vezenovm
Copy link
Contributor

vezenovm commented Feb 5, 2024

Is this issue related (#2540)? @michaeljklein Could you check if it is resolved by your work?

@jfecher
Copy link
Contributor

jfecher commented Feb 5, 2024

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

@TomAFrench
Copy link
Member

This will no longer panic once #4408 is merged but is still active.

@Savio-Sou Savio-Sou moved this from 📋 Backlog to 🏗 In progress in Noir Feb 23, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 19, 2024
# Description

Replacement for #4232. Holding off
on closing it to possibly port fixes from it, but wanted to start fresh
because this approach is quite different.

## Problem\*

Resolves #4220

## Summary\*

- Removes `NotConstant`
- Separate syntax for slice literals: `&[..]`
- Separate AST/type constructors for slices

Notes:
- I removed several broken links that were blocking updating the docs:
+ A few were to a missing `reference` docs folder, likely from an
in-progress branch
+ One was to some `base_order_curve`, which has been moved to reference
the `BigInt` struct

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Jake Fecher <jfecher11@gmail.com>
Co-authored-by: jfecher <jake@aztecprotocol.com>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Noir Mar 19, 2024
TomAFrench pushed a commit that referenced this issue Apr 3, 2024
# Description

Replacement for #4232. Holding off
on closing it to possibly port fixes from it, but wanted to start fresh
because this approach is quite different.

## Problem\*

Resolves #4220

## Summary\*

- Removes `NotConstant`
- Separate syntax for slice literals: `&[..]`
- Separate AST/type constructors for slices

Notes:
- I removed several broken links that were blocking updating the docs:
+ A few were to a missing `reference` docs folder, likely from an
in-progress branch
+ One was to some `base_order_curve`, which has been moved to reference
the `BigInt` struct

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Jake Fecher <jfecher11@gmail.com>
Co-authored-by: jfecher <jake@aztecprotocol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
4 participants