Skip to content

Commit de6e9db

Browse files
committed
Update builder.rs
1 parent 614b934 commit de6e9db

File tree

1 file changed

+9
-4
lines changed
  • crates/ty_python_semantic/src/semantic_index

1 file changed

+9
-4
lines changed

crates/ty_python_semantic/src/semantic_index/builder.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,18 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
428428
/// ```
429429
fn update_lazy_snapshots(&mut self, symbol: ScopedSymbolId) {
430430
let current_scope = self.current_scope();
431+
let current_place_table = &self.place_tables[current_scope];
432+
let symbol = current_place_table.symbol(symbol);
433+
if !symbol.is_reassigned() {
434+
return;
435+
}
431436
for (key, snapshot_id) in &self.enclosing_snapshots {
432437
if let Some(enclosing_symbol) = key.enclosing_place.as_symbol() {
438+
let name = self.place_tables[key.enclosing_scope]
439+
.symbol(enclosing_symbol)
440+
.name();
433441
if key.nested_laziness.is_lazy()
434-
&& enclosing_symbol == symbol
435-
&& self.place_tables[current_scope]
436-
.symbol(symbol)
437-
.is_reassigned()
442+
&& symbol.name() == name
438443
&& (key.enclosing_scope == current_scope
439444
|| VisibleAncestorsIter::new(&self.scopes, key.enclosing_scope)
440445
.any(|(ancestor, _)| ancestor == current_scope))

0 commit comments

Comments
 (0)