Skip to content

Commit

Permalink
chore: regression test for #2540 (#4602)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves #2540

## Summary\*

Fixed in #4504

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] 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.
  • Loading branch information
michaeljklein authored and TomAFrench committed Apr 3, 2024
1 parent ee02a29 commit 39c4e8a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions compiler/noirc_frontend/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,22 @@ fn lambda$f1(mut env$l1: (Field)) -> Field {
assert_eq!(get_program_errors(src).len(), 2);
}

// Regression for #2540
#[test]
fn for_loop_over_array() {
let src = r#"
fn hello<N>(_array: [u1; N]) {
for _ in 0..N {}
}
fn main() {
let array: [u1; 2] = [0, 1];
hello(array);
}
"#;
assert_eq!(get_program_errors(src).len(), 0);
}

// Regression for #4545
#[test]
fn type_aliases_in_main() {
Expand Down

0 comments on commit 39c4e8a

Please sign in to comment.