From 678b8e779b9152cd20dd8cc7002e9716d3d3bcbe Mon Sep 17 00:00:00 2001 From: minoring Date: Sat, 5 Sep 2020 22:37:52 +0900 Subject: [PATCH] Modify `nonlocal` to be declared multiple times Related to #2183 --- src/symboltable.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/symboltable.rs b/src/symboltable.rs index 67c8018..4e7fbef 100644 --- a/src/symboltable.rs +++ b/src/symboltable.rs @@ -1025,14 +1025,7 @@ impl SymbolTableBuilder { let symbol = table.symbols.get_mut(name).unwrap(); match role { SymbolUsage::Nonlocal => { - if let SymbolScope::Unknown = symbol.scope { - symbol.scope = SymbolScope::Nonlocal; - } else { - return Err(SymbolTableError { - error: format!("Symbol {} scope cannot be set to nonlocal, since its scope was already determined otherwise.", name), - location, - }); - } + symbol.scope = SymbolScope::Nonlocal; } SymbolUsage::Imported => { symbol.is_assigned = true;