Skip to content

Commit 9197f92

Browse files
committed
[ConstraintSystem] Increase impact of implicit value-to-value conversion
This makes it possible to pick `CGFloat` function/operator overloads even in the presence of literals, otherwise non-default literal score gets in a way and solver ends up producing a lot more solutions with implicit Double<->CGFloat conversion than it can disambiguate, so it's better to just preserve the old behavior and pick `CGFloat` concrete overloads when appropriate.
1 parent ba2bf82 commit 9197f92

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,10 @@ enum ScoreKind {
792792
SK_UnresolvedMemberViaOptional,
793793
/// An implicit force of an implicitly unwrapped optional value.
794794
SK_ForceUnchecked,
795+
/// An implicit conversion from a value of one type (lhs)
796+
/// to another type (rhs) via implicit initialization of
797+
/// `rhs` type which an argument of `lhs` value.
798+
SK_ImplicitValueConversion,
795799
/// A user-defined conversion.
796800
SK_UserConversion,
797801
/// A non-trivial function conversion.
@@ -810,12 +814,8 @@ enum ScoreKind {
810814
SK_ValueToPointerConversion,
811815
/// A closure/function conversion to an autoclosure parameter.
812816
SK_FunctionToAutoClosureConversion,
813-
/// An implicit conversion from a value of one type (lhs)
814-
/// to another type (rhs) via implicit initialization of
815-
/// `rhs` type which an argument of `lhs` value.
816-
SK_ImplicitValueConversion,
817817

818-
SK_LastScoreKind = SK_ImplicitValueConversion,
818+
SK_LastScoreKind = SK_FunctionToAutoClosureConversion,
819819
};
820820

821821
/// The number of score kinds.

0 commit comments

Comments
 (0)