Skip to content

Commit

Permalink
fix: Fix panic in get_global_let_statement (#5177)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [ ] 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
jfecher authored Jun 5, 2024
1 parent 967c0fa commit b769b01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/noirc_frontend/src/node_interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,9 @@ impl NodeInterner {
match def {
Node::Statement(hir_stmt) => match hir_stmt {
HirStatement::Let(let_stmt) => Some(let_stmt.clone()),
_ => {
panic!("ice: all globals should correspond to a let statement in the interner")
HirStatement::Error => None,
other => {
panic!("ice: all globals should correspond to a let statement in the interner: {other:?}")
}
},
_ => panic!("ice: all globals should correspond to a statement in the interner"),
Expand Down

0 comments on commit b769b01

Please sign in to comment.