@@ -4380,14 +4380,8 @@ static bool typeCheckDerivativeAttr(ASTContext &Ctx, Decl *D,
4380
4380
// requirements are not satisfied.
4381
4381
if (!source)
4382
4382
return false ;
4383
- // Check if target's requirements are satisfied by source.
4384
- // Use invalid 'SourceLoc's to suppress diagnostics.
4385
- return TypeChecker::checkGenericArguments (
4386
- derivative, SourceLoc (), SourceLoc (), Type (),
4387
- source->getGenericParams (), target->getRequirements (),
4388
- [](SubstitutableType *dependentType) {
4389
- return Type (dependentType);
4390
- }) == RequirementCheckResult::Success;
4383
+
4384
+ return target->requirementsNotSatisfiedBy (source).empty ();
4391
4385
};
4392
4386
4393
4387
auto isValidOriginal = [&](AbstractFunctionDecl *originalCandidate) {
@@ -4914,17 +4908,8 @@ void AttributeChecker::visitTransposeAttr(TransposeAttr *attr) {
4914
4908
// requirements are not satisfied.
4915
4909
if (!source)
4916
4910
return false ;
4917
- // Check if target's requirements are satisfied by source.
4918
- // Use invalid 'SourceLoc's to suppress diagnostics.
4919
- // Diagnostics should not be emitted because this function is used to
4920
- // check candidates; if no candidates match, a separate diagnostic will
4921
- // be produced.
4922
- return TypeChecker::checkGenericArguments (
4923
- transpose, SourceLoc (), SourceLoc (), Type (),
4924
- source->getGenericParams (), target->getRequirements (),
4925
- [](SubstitutableType *dependentType) {
4926
- return Type (dependentType);
4927
- }) == RequirementCheckResult::Success;
4911
+
4912
+ return target->requirementsNotSatisfiedBy (source).empty ();
4928
4913
};
4929
4914
4930
4915
auto isValidOriginal = [&](AbstractFunctionDecl *originalCandidate) {
0 commit comments