Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Display function name and body when inlining recursion limit hit (…
…#6291) # Description ## Problem\* Resolves #4828 ## Summary\* Given a program like this: ``` fn main() { main(); } ``` Changed this panic message: ``` Attempted to recur more than 1000 times during function inlining. ``` Into this: ``` Attempted to recur more than 1000 times during inlining function 'main': acir(inline) fn main f0 { b0(): call f0() return } ``` I included the ACIR to help figure out which function is the culprit, in case the name is not enough. ## Additional Context I added a test to show that there is no compilation error or warning for the example program. It would be nice to issue a warning about unconditional recursion like Rust does. I'll try to do that in a followup PR. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information