File tree Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -2178,17 +2178,14 @@ void ConstraintSystem::partitionDisjunction(
2178
2178
SmallVector<unsigned , 4 > genericOverloads;
2179
2179
2180
2180
forEachChoice (Choices, [&](unsigned index, Constraint *constraint) -> bool {
2181
- if (!isForCodeCompletion ()) {
2181
+ if (!isForCodeCompletion () && isOperatorBindOverload (constraint) ) {
2182
2182
// Collect generic overload choices separately, and sort these choices
2183
2183
// by specificity in order to try the most specific choice first.
2184
- if (constraint->getKind () == ConstraintKind::BindOverload) {
2185
- if (auto *decl = constraint->getOverloadChoice ().getDeclOrNull ()) {
2186
- auto *fnDecl = dyn_cast<AbstractFunctionDecl>(decl);
2187
- if (fnDecl && fnDecl->isGeneric ()) {
2188
- genericOverloads.push_back (index);
2189
- return true ;
2190
- }
2191
- }
2184
+ auto *decl = constraint->getOverloadChoice ().getDecl ();
2185
+ auto *fnDecl = dyn_cast<AbstractFunctionDecl>(decl);
2186
+ if (fnDecl && fnDecl->isGeneric ()) {
2187
+ genericOverloads.push_back (index);
2188
+ return true ;
2192
2189
}
2193
2190
}
2194
2191
Original file line number Diff line number Diff line change @@ -580,18 +580,6 @@ static bool isDeclSubstitutable(ValueDecl *declA, ValueDecl *declB) {
580
580
false );
581
581
}
582
582
583
- static bool isGenericDisjunctionChoice (Constraint *constraint) {
584
- if (constraint->getKind () != ConstraintKind::BindOverload)
585
- return false ;
586
-
587
- auto choice = constraint->getOverloadChoice ();
588
- if (!choice.isDecl ())
589
- return false ;
590
-
591
- auto *funcDecl = dyn_cast<AbstractFunctionDecl>(choice.getDecl ());
592
- return funcDecl && funcDecl->isGeneric ();
593
- }
594
-
595
583
bool DisjunctionStep::shouldSkip (const DisjunctionChoice &choice) const {
596
584
auto &ctx = CS.getASTContext ();
597
585
@@ -624,7 +612,7 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
624
612
// can be unconditionally substituted by the current choice, skip the current
625
613
// choice.
626
614
if (LastSolvedChoice && LastSolvedChoice->second == getCurrentScore () &&
627
- isGenericDisjunctionChoice ( choice)) {
615
+ choice. isGenericOperator ( )) {
628
616
auto *declA = LastSolvedChoice->first ->getOverloadChoice ().getDecl ();
629
617
auto *declB = static_cast <Constraint *>(choice)->getOverloadChoice ().getDecl ();
630
618
You can’t perform that action at this time.
0 commit comments