Skip to content

Commit 3706dca

Browse files
committed
revert now-unnecessary change
1 parent 1fcf584 commit 3706dca

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

crates/red_knot_python_semantic/src/symbol.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,9 @@ fn symbol_from_bindings_impl<'db>(
752752

753753
if let Some(first) = types.next() {
754754
let boundness = match unbound_visibility {
755-
Truthiness::AlwaysTrue => return Symbol::Unbound,
755+
Truthiness::AlwaysTrue => {
756+
unreachable!("If we have at least one binding, the scope-start should not be definitely visible")
757+
}
756758
Truthiness::AlwaysFalse => Boundness::Bound,
757759
Truthiness::Ambiguous => Boundness::PossiblyUnbound,
758760
};
@@ -841,7 +843,9 @@ fn symbol_from_declarations_impl<'db>(
841843
};
842844
if conflicting.is_empty() {
843845
let boundness = match undeclared_visibility {
844-
Truthiness::AlwaysTrue => return Ok(Symbol::Unbound.into()),
846+
Truthiness::AlwaysTrue => {
847+
unreachable!("If we have at least one declaration, the scope-start should not be definitely visible")
848+
}
845849
Truthiness::AlwaysFalse => Boundness::Bound,
846850
Truthiness::Ambiguous => Boundness::PossiblyUnbound,
847851
};

crates/red_knot_python_semantic/src/types/class.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ impl<'db> Class<'db> {
401401
/// directly. Use [`Class::class_member`] if you require a method that will
402402
/// traverse through the MRO until it finds the member.
403403
pub(super) fn own_class_member(self, db: &'db dyn Db, name: &str) -> SymbolAndQualifiers<'db> {
404-
class_symbol(db, self.body_scope(db), name)
404+
let body_scope = self.body_scope(db);
405+
class_symbol(db, body_scope, name)
405406
}
406407

407408
/// Returns the `name` attribute of an instance of this class.

0 commit comments

Comments
 (0)