@@ -638,7 +638,13 @@ class GenericSignatureBuilder {
638
638
// / Process any delayed requirements that can be handled now.
639
639
void processDelayedRequirements ();
640
640
641
+ class ExplicitRequirement ;
642
+
643
+ bool isRedundantExplicitRequirement (ExplicitRequirement req) const ;
644
+
641
645
private:
646
+ void computeRedundantRequirements ();
647
+
642
648
// / Describes the relationship between a given constraint and
643
649
// / the canonical constraint of the equivalence class.
644
650
enum class ConstraintRelation {
@@ -669,6 +675,7 @@ class GenericSignatureBuilder {
669
675
Constraint<T> checkConstraintList (
670
676
TypeArrayView<GenericTypeParamType> genericParams,
671
677
std::vector<Constraint<T>> &constraints,
678
+ RequirementKind kind,
672
679
llvm::function_ref<bool (const Constraint<T> &)>
673
680
isSuitableRepresentative,
674
681
llvm::function_ref<
@@ -694,6 +701,7 @@ class GenericSignatureBuilder {
694
701
Constraint<T> checkConstraintList (
695
702
TypeArrayView<GenericTypeParamType> genericParams,
696
703
std::vector<Constraint<T>> &constraints,
704
+ RequirementKind kind,
697
705
llvm::function_ref<bool (const Constraint<T> &)>
698
706
isSuitableRepresentative,
699
707
llvm::function_ref<
@@ -1206,6 +1214,10 @@ class GenericSignatureBuilder::RequirementSource final
1206
1214
// / path.
1207
1215
bool isDerivedRequirement () const ;
1208
1216
1217
+ // / Same as above, but we consider RequirementSignatureSelf to not be
1218
+ // / derived.
1219
+ bool isDerivedNonRootRequirement () const ;
1220
+
1209
1221
// / Whether we should diagnose a redundant constraint based on this
1210
1222
// / requirement source.
1211
1223
// /
0 commit comments