Skip to content

Commit

Permalink
Example of mutual recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Oct 16, 2024
1 parent a83a19d commit 0e29ea2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions compiler/noirc_frontend/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3470,6 +3470,18 @@ fn unconditional_recursion_pass() {
if i == 0 { 0 } else { i + main(i-1) }
}
"#,
// Only immediate self-recursion is detected.
r#"
fn main() {
foo();
}
fn foo() {
bar();
}
fn bar() {
foo();
}
"#,
];

for src in srcs {

Check warning on line 3487 in compiler/noirc_frontend/src/tests.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (srcs)
Expand Down

0 comments on commit 0e29ea2

Please sign in to comment.