From fc61c2140e24ddc534184e6273619ce516af7243 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Thu, 9 Jan 2025 10:49:41 -0500 Subject: [PATCH] chore: Only resolved globals monomorphization (#7006) --- compiler/noirc_frontend/src/monomorphization/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index ce855f62526..c3a32f979d4 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -934,11 +934,9 @@ impl<'interner> Monomorphizer<'interner> { .into_hir_expression(self.interner, global.location) .map_err(MonomorphizationError::InterpreterError)? } else { - let let_ = self.interner.get_global_let_statement(*global_id).expect( - "Globals should have a corresponding let statement by monomorphization", - ); - let_.expression + unreachable!("All global values should be resolved at compile time and before monomorphization"); }; + self.expr(expr)? } DefinitionKind::Local(_) => match self.lookup_captured_expr(ident.id) {