Skip to content

Commit b13c219

Browse files
committed
[ConstraintSystem] Add a new score kind to denote presence of missing conformances
The types with missing conformances are allowed to appear in a valid solution but such solutions should be ranked lower comparing to solutions fewer or without them.
1 parent 22592d2 commit b13c219

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,12 @@ enum ScoreKind: unsigned int {
988988
/// ambiguity tie-breakers should go after this; anything else
989989
/// should be added above.
990990
SK_UnappliedFunction,
991+
/// A type with a missing conformance(s) that has be synthesized
992+
/// or diagnosed later, such types are allowed to appear in
993+
/// a valid solution.
994+
SK_MissingSynthesizableConformance,
991995

992-
SK_LastScoreKind = SK_UnappliedFunction,
996+
SK_LastScoreKind = SK_MissingSynthesizableConformance,
993997
};
994998

995999
/// The number of score kinds.
@@ -1153,6 +1157,9 @@ struct Score {
11531157

11541158
case SK_UnappliedFunction:
11551159
return "use of overloaded unapplied function";
1160+
1161+
case SK_MissingSynthesizableConformance:
1162+
return "type with missing synthesizable conformance";
11561163
}
11571164
}
11581165

0 commit comments

Comments
 (0)