mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:34:57 +00:00
[ty] Remove incorrect type narrowing for if type(x) is C[int]
(#19926)
This commit is contained in:
parent
f344dda82c
commit
9ced219ffc
2 changed files with 52 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue