@@ -17,6 +17,7 @@ use crate::db::Db;
1717use crate :: dunder_all:: dunder_all_names;
1818use crate :: place:: { Boundness , Place } ;
1919use crate :: types:: call:: arguments:: { Expansion , is_expandable_type} ;
20+ use crate :: types:: constraints:: { ConstraintSet , Constraints } ;
2021use 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