Skip to content

Commit 9c81ce6

Browse files
committed
Fix is_local
1 parent 85f6574 commit 9c81ce6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/codegen/src/symboltable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl Symbol {
150150
}
151151

152152
pub fn is_local(&self) -> bool {
153-
self.scope == SymbolScope::Local
153+
matches!(self.scope, SymbolScope::Local | SymbolScope::Cell)
154154
}
155155

156156
pub fn is_bound(&self) -> bool {

vm/src/stdlib/symtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ mod symtable {
179179

180180
#[pymethod]
181181
fn is_local(&self) -> bool {
182-
self.symbol.is_local()
182+
self.symbol.is_local() || (self.is_top_scope && self.symbol.is_bound())
183183
}
184184

185185
#[pymethod]

0 commit comments

Comments
 (0)