mirror of https://github.com/astral-sh/ruff
treat each overload separately
This commit is contained in:
parent
54a4f2ec58
commit
3384392747
|
|
@ -1655,21 +1655,14 @@ impl<'db> SpecializationBuilder<'db> {
|
|||
return Ok(());
|
||||
};
|
||||
|
||||
let mut when = ConstraintSet::from(false);
|
||||
for formal_signature in &formal_callable.signatures(self.db).overloads {
|
||||
for actual_callable in actual_callables.as_slice() {
|
||||
for actual_signature in &actual_callable.signatures(self.db).overloads {
|
||||
when.union(
|
||||
self.db,
|
||||
formal_signature.when_constraint_set_assignable_to(
|
||||
let when = formal_signature.when_constraint_set_assignable_to(
|
||||
self.db,
|
||||
actual_signature,
|
||||
self.inferable,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when.for_each_path(self.db, |path| {
|
||||
for constraint in path.positive_constraints() {
|
||||
|
|
@ -1702,6 +1695,9 @@ impl<'db> SpecializationBuilder<'db> {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add more forms that we can structurally induct into: type[C], callables
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue