mirror of https://github.com/astral-sh/ruff
put the experimental change back but actually land it this time
This commit is contained in:
parent
fd7b9298dd
commit
c1277669d2
|
|
@ -1028,18 +1028,6 @@ impl<'db> FunctionType<'db> {
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
// A function type is the subtype of itself, and not of any other function type. However,
|
|
||||||
// our representation of a function type includes any specialization that should be applied
|
|
||||||
// to the signature. Different specializations of the same function type are only subtypes
|
|
||||||
// of each other if they result in subtype signatures.
|
|
||||||
if matches!(
|
|
||||||
relation,
|
|
||||||
TypeRelation::Subtyping | TypeRelation::Redundancy | TypeRelation::SubtypingAssuming(_)
|
|
||||||
) && self.normalized(db) == other.normalized(db)
|
|
||||||
{
|
|
||||||
return ConstraintSet::from(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.literal(db) != other.literal(db) {
|
if self.literal(db) != other.literal(db) {
|
||||||
return ConstraintSet::from(false);
|
return ConstraintSet::from(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue