Skip to content

Commit 3ade391

Browse files
authored
Merge pull request swiftlang#12948 from slavapestov/fix-source-compatibility-regression
Revert "[CSRanking] Delete a pointless old ranking hack. NFC"
2 parents 9733024 + 3c07c27 commit 3ade391

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/CSRanking.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,16 @@ ConstraintSystem::compareSolutions(ConstraintSystem &cs,
10361036
continue;
10371037
}
10381038

1039+
// A concrete type is better than an archetype.
1040+
// FIXME: Total hack.
1041+
if (type1->is<ArchetypeType>() != type2->is<ArchetypeType>()) {
1042+
if (type1->is<ArchetypeType>())
1043+
++score2;
1044+
else
1045+
++score1;
1046+
continue;
1047+
}
1048+
10391049
// FIXME:
10401050
// This terrible hack is in place to support equality comparisons of non-
10411051
// equatable option types to 'nil'. Until we have a way to constrain a type

0 commit comments

Comments
 (0)