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

bug: loop, for and while don't require their body to be () #7408

Closed
asterite opened this issue Feb 17, 2025 · 0 comments · Fixed by #7437
Closed

bug: loop, for and while don't require their body to be () #7408

asterite opened this issue Feb 17, 2025 · 0 comments · Fixed by #7437
Labels
bug Something isn't working
Milestone

Comments

@asterite
Copy link
Collaborator

Aim

Given this code:

fn main() {
    for _ in 0..10 {
        10
    }
}

Expected Behavior

The compiler should give an error saying that the for body's type should be (), not Field.

Bug

The code gives no error (unlike Rust).

The same applies to loop and while.

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

@asterite asterite added the bug Something isn't working label Feb 17, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 17, 2025
@asterite asterite mentioned this issue Feb 17, 2025
5 tasks
@TomAFrench TomAFrench added this to the 1.0 milestone Feb 18, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Feb 19, 2025
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
Development

Successfully merging a pull request may close this issue.

2 participants