@@ -756,8 +756,8 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
756
756
bool isStdlibOptionalMPlusOperator1 = false ;
757
757
bool isStdlibOptionalMPlusOperator2 = false ;
758
758
759
- bool isSwift4ConcreteOverProtocolVar1 = false ;
760
- bool isSwift4ConcreteOverProtocolVar2 = false ;
759
+ bool isVarAndNotProtocol1 = false ;
760
+ bool isVarAndNotProtocol2 = false ;
761
761
762
762
auto getWeight = [&](ConstraintLocator *locator) -> unsigned {
763
763
if (auto *anchor = locator->getAnchor ()) {
@@ -986,8 +986,8 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
986
986
auto *nominal1 = dc1->getSelfNominalTypeDecl ();
987
987
auto *nominal2 = dc2->getSelfNominalTypeDecl ();
988
988
if (nominal1 && nominal2 && nominal1 != nominal2) {
989
- isSwift4ConcreteOverProtocolVar1 = isa<ProtocolDecl>(nominal2 );
990
- isSwift4ConcreteOverProtocolVar2 = isa<ProtocolDecl>(nominal1 );
989
+ isVarAndNotProtocol1 = ! isa<ProtocolDecl>(nominal1 );
990
+ isVarAndNotProtocol2 = ! isa<ProtocolDecl>(nominal2 );
991
991
}
992
992
}
993
993
@@ -1151,8 +1151,8 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
1151
1151
// preferring var members in concrete types over a protocol requirement
1152
1152
// (see the comment above for the rationale of this hack).
1153
1153
if (!tc.Context .isSwiftVersionAtLeast (5 ) && score1 == score2) {
1154
- score1 += isSwift4ConcreteOverProtocolVar1 ;
1155
- score2 += isSwift4ConcreteOverProtocolVar2 ;
1154
+ score1 += isVarAndNotProtocol1 ;
1155
+ score2 += isVarAndNotProtocol2 ;
1156
1156
}
1157
1157
1158
1158
// FIXME: There are type variables and overloads not common to both solutions
0 commit comments