From 40d71d6b83d1a83c8f18009b38ef8d126954ad49 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Sat, 3 Feb 2024 13:01:34 +0100 Subject: [PATCH] prog --- lib/edlang_lowering/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/edlang_lowering/src/lib.rs b/lib/edlang_lowering/src/lib.rs index c3d440624..8c8176ab6 100644 --- a/lib/edlang_lowering/src/lib.rs +++ b/lib/edlang_lowering/src/lib.rs @@ -30,13 +30,13 @@ pub fn lower_modules(modules: &[ast::Module]) -> Vec { } fn lower_module(mut ctx: BuildCtx, module: &ast::Module) -> (BuildCtx, ir::ModuleBody) { + let module_id = *ctx.module_name_to_id.get(&module.name.name).unwrap(); let mut body = ir::ModuleBody { - module_id: ctx.module_id_counter, + module_id, functions: Default::default(), modules: Default::default(), span: module.span, }; - ctx.module_id_counter += 1; let mut module_ctx = ModuleCtx { id: body.module_id,