Skip to content

Commit 7071e7f

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. (cherry picked from commit b13c219)
1 parent 53d27fc commit 7071e7f

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
@@ -989,8 +989,12 @@ enum ScoreKind: unsigned int {
989989
/// ambiguity tie-breakers should go after this; anything else
990990
/// should be added above.
991991
SK_UnappliedFunction,
992+
/// A type with a missing conformance(s) that has be synthesized
993+
/// or diagnosed later, such types are allowed to appear in
994+
/// a valid solution.
995+
SK_MissingSynthesizableConformance,
992996

993-
SK_LastScoreKind = SK_UnappliedFunction,
997+
SK_LastScoreKind = SK_MissingSynthesizableConformance,
994998
};
995999

9961000
/// The number of score kinds.
@@ -1154,6 +1158,9 @@ struct Score {
11541158

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

0 commit comments

Comments
 (0)