Skip to content

Commit

Permalink
Add a couple more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Nov 5, 2024
1 parent 205548b commit 03baa50
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion compiler/noirc_frontend/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3625,7 +3625,7 @@ fn use_type_alias_to_generic_concrete_type_in_method_call() {
}

#[test]
fn allows_struct_with_generic_infix_type_as_main_input() {
fn allows_struct_with_generic_infix_type_as_main_input_1() {
let src = r#"
struct Foo<let N: u32> {
x: [u64; N * 2],
Expand All @@ -3635,3 +3635,29 @@ fn allows_struct_with_generic_infix_type_as_main_input() {
"#;
assert_no_errors(src);
}

#[test]
fn allows_struct_with_generic_infix_type_as_main_input_2() {
let src = r#"
struct Foo<let N: u32> {
x: [u64; N * 2],
}
fn main(_x: Foo<2 * 9>) {}
"#;
assert_no_errors(src);
}

#[test]
fn allows_struct_with_generic_infix_type_as_main_input_3() {
let src = r#"
struct Foo<let N: u32> {
x: [u64; N * 2],
}
global N = 9;
fn main(_x: Foo<N * 2>) {}
"#;
assert_no_errors(src);
}

0 comments on commit 03baa50

Please sign in to comment.