From 605cb351ddcbbee02cf2896a1f47dcc436766bc6 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Wed, 5 Jun 2024 12:27:14 +0100 Subject: [PATCH] Fix panic in get_global --- compiler/noirc_frontend/src/node_interner.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index e28a0a64ad0..c223017d752 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -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"),