From e16d996325f856ebe09deee1c885ac9daab56dcd Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Thu, 9 May 2024 22:18:04 +0100 Subject: [PATCH] Fix lexical scope id calculation on creation. --- sway-core/src/semantic_analysis/namespace/module.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway-core/src/semantic_analysis/namespace/module.rs b/sway-core/src/semantic_analysis/namespace/module.rs index bfa1f683945..e98c7f07f6d 100644 --- a/sway-core/src/semantic_analysis/namespace/module.rs +++ b/sway-core/src/semantic_analysis/namespace/module.rs @@ -229,7 +229,7 @@ impl Module { parent: Some(previous_scope_id), ..Default::default() }); - self.current_lexical_scope_id() + self.lexical_scopes.len() - 1 }; let previous_scope = self.lexical_scopes.get_mut(previous_scope_id).unwrap(); previous_scope.children.push(new_scoped_id);