We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e71f3ed commit 25c3be5Copy full SHA for 25c3be5
crates/red_knot_python_semantic/src/types/narrow.rs
@@ -512,19 +512,10 @@ impl<'db> NarrowingConstraintsBuilder<'db> {
512
None
513
}
514
515
- (_, Type::BooleanLiteral(b)) => {
516
- if b {
517
- Some(
518
- UnionType::from_elements(self.db, [rhs_ty, Type::IntLiteral(1)])
519
- .negate(self.db),
520
- )
521
- } else {
522
523
- UnionType::from_elements(self.db, [rhs_ty, Type::IntLiteral(0)])
524
525
526
- }
527
+ (_, Type::BooleanLiteral(b)) => Some(
+ UnionType::from_elements(self.db, [rhs_ty, Type::IntLiteral(i64::from(b))])
+ .negate(self.db),
+ ),
528
_ if rhs_ty.is_single_valued(self.db) => Some(rhs_ty.negate(self.db)),
529
_ => None,
530
0 commit comments