@@ -638,7 +638,13 @@ class GenericSignatureBuilder {
638638 // / Process any delayed requirements that can be handled now.
639639 void processDelayedRequirements ();
640640
641+ class ExplicitRequirement ;
642+
643+ bool isRedundantExplicitRequirement (ExplicitRequirement req) const ;
644+
641645private:
646+ void computeRedundantRequirements ();
647+
642648 // / Describes the relationship between a given constraint and
643649 // / the canonical constraint of the equivalence class.
644650 enum class ConstraintRelation {
@@ -669,6 +675,7 @@ class GenericSignatureBuilder {
669675 Constraint<T> checkConstraintList (
670676 TypeArrayView<GenericTypeParamType> genericParams,
671677 std::vector<Constraint<T>> &constraints,
678+ RequirementKind kind,
672679 llvm::function_ref<bool (const Constraint<T> &)>
673680 isSuitableRepresentative,
674681 llvm::function_ref<
@@ -694,6 +701,7 @@ class GenericSignatureBuilder {
694701 Constraint<T> checkConstraintList (
695702 TypeArrayView<GenericTypeParamType> genericParams,
696703 std::vector<Constraint<T>> &constraints,
704+ RequirementKind kind,
697705 llvm::function_ref<bool (const Constraint<T> &)>
698706 isSuitableRepresentative,
699707 llvm::function_ref<
@@ -1206,6 +1214,10 @@ class GenericSignatureBuilder::RequirementSource final
12061214 // / path.
12071215 bool isDerivedRequirement () const ;
12081216
1217+ // / Same as above, but we consider RequirementSignatureSelf to not be
1218+ // / derived.
1219+ bool isDerivedNonRootRequirement () const ;
1220+
12091221 // / Whether we should diagnose a redundant constraint based on this
12101222 // / requirement source.
12111223 // /
0 commit comments