[ty] Remove incorrect type narrowing for if type(x) is C[int] (#19926)

This commit is contained in:
Alex Waygood 2025-08-15 17:52:14 +01:00 committed by GitHub
parent f344dda82c
commit 9ced219ffc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 6 deletions

View file

@ -756,12 +756,8 @@ impl<'db, 'ast> NarrowingConstraintsBuilder<'db, 'ast> {
node_index: _,
},
}) if keywords.is_empty() => {
let rhs_class = match rhs_ty {
Type::ClassLiteral(class) => class,
Type::GenericAlias(alias) => alias.origin(self.db),
_ => {
continue;
}
let Type::ClassLiteral(rhs_class) = rhs_ty else {
continue;
};
let target = match &**args {