Skip to content

Commit

Permalink
Update crates/red_knot_python_semantic/src/types/infer.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
carljm and AlexWaygood authored Aug 28, 2024
1 parent 518e4d4 commit e4eabd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/red_knot_python_semantic/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,9 @@ impl<'db> TypeInferenceBuilder<'db> {
// if we're inferring types of deferred expressions, always treat them as public symbols
if self.is_deferred() {
let symbols = self.index.symbol_table(file_scope_id);
// SAFETY: the symbol table always creates a symbol for every Name node.
let symbol = symbols.symbol_id_by_name(id).unwrap();
let symbol = symbols
.symbol_id_by_name(id)
.expect("Expected the symbol table to create a symbol for every Name node");
return symbol_ty(self.db, self.scope, symbol);
}

Expand Down

0 comments on commit e4eabd1

Please sign in to comment.