@@ -661,27 +661,29 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
661
661
if (checkRequirementsEarly ()) {
662
662
Constraint *constraint = choice;
663
663
auto *decl = constraint->getOverloadChoice ().getDecl ();
664
- auto *useDC = constraint->getOverloadUseDC ();
665
- auto choiceType = CS.getEffectiveOverloadType (constraint->getOverloadChoice (),
666
- /* allowMembers=*/ true , useDC);
667
- auto choiceFnType = choiceType->getAs <FunctionType>();
668
- auto genericFnType = decl->getInterfaceType ()->getAs <GenericFunctionType>();
669
- auto signature = genericFnType->getGenericSignature ();
670
-
671
- for (auto argParamPair : llvm::zip (argFnType->getParams (),
672
- choiceFnType->getParams ())) {
673
- auto argType = std::get<0 >(argParamPair).getPlainType ();
674
- auto paramType = std::get<1 >(argParamPair).getPlainType ();
675
-
676
- // Only check argument types with no type variables that will be matched
677
- // against a plain type parameter.
678
- argType = argType->getCanonicalType ()->getWithoutSpecifierType ();
679
- if (argType->hasTypeVariable () || !paramType->isTypeParameter ())
680
- continue ;
681
-
682
- for (auto *protocol : signature->getRequiredProtocols (paramType)) {
683
- if (!TypeChecker::conformsToProtocol (argType, protocol, useDC))
684
- return skip (" unsatisfied" );
664
+ if (decl->getBaseIdentifier ().isArithmeticOperator ()) {
665
+ auto *useDC = constraint->getOverloadUseDC ();
666
+ auto choiceType = CS.getEffectiveOverloadType (constraint->getOverloadChoice (),
667
+ /* allowMembers=*/ true , useDC);
668
+ auto choiceFnType = choiceType->getAs <FunctionType>();
669
+ auto genericFnType = decl->getInterfaceType ()->getAs <GenericFunctionType>();
670
+ auto signature = genericFnType->getGenericSignature ();
671
+
672
+ for (auto argParamPair : llvm::zip (argFnType->getParams (),
673
+ choiceFnType->getParams ())) {
674
+ auto argType = std::get<0 >(argParamPair).getPlainType ();
675
+ auto paramType = std::get<1 >(argParamPair).getPlainType ();
676
+
677
+ // Only check argument types with no type variables that will be matched
678
+ // against a plain type parameter.
679
+ argType = argType->getCanonicalType ()->getWithoutSpecifierType ();
680
+ if (argType->hasTypeVariable () || !paramType->isTypeParameter ())
681
+ continue ;
682
+
683
+ for (auto *protocol : signature->getRequiredProtocols (paramType)) {
684
+ if (!TypeChecker::conformsToProtocol (argType, protocol, useDC))
685
+ return skip (" unsatisfied" );
686
+ }
685
687
}
686
688
}
687
689
}
0 commit comments