Skip to content

Commit ae2bf01

Browse files
committed
call binding is "ever assignable", not "always"!
1 parent f95056a commit ae2bf01

File tree

1 file changed

+5
-1
lines changed
  • crates/ty_python_semantic/src/types/call

1 file changed

+5
-1
lines changed

crates/ty_python_semantic/src/types/call/bind.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::db::Db;
1717
use crate::dunder_all::dunder_all_names;
1818
use crate::place::{Boundness, Place};
1919
use crate::types::call::arguments::{Expansion, is_expandable_type};
20+
use crate::types::constraints::{ConstraintSet, Constraints};
2021
use crate::types::diagnostic::{
2122
CALL_NON_CALLABLE, CONFLICTING_ARGUMENT_FORMS, INVALID_ARGUMENT_TYPE, MISSING_ARGUMENT,
2223
NO_MATCHING_OVERLOAD, PARAMETER_ALREADY_ASSIGNED, TOO_MANY_POSITIONAL_ARGUMENTS,
@@ -2198,7 +2199,10 @@ impl<'a, 'db> ArgumentTypeChecker<'a, 'db> {
21982199
argument_type.apply_specialization(self.db, inherited_specialization);
21992200
expected_ty = expected_ty.apply_specialization(self.db, inherited_specialization);
22002201
}
2201-
if !argument_type.is_assignable_to(self.db, expected_ty) {
2202+
if argument_type
2203+
.when_assignable_to::<ConstraintSet>(self.db, expected_ty)
2204+
.is_never_satisfied(self.db)
2205+
{
22022206
let positional = matches!(argument, Argument::Positional | Argument::Synthetic)
22032207
&& !parameter.is_variadic();
22042208
self.errors.push(BindingError::InvalidArgumentType {

0 commit comments

Comments
 (0)