Skip to content

Commit 7a15b7a

Browse files
authored
Merge pull request #37157 from slavapestov/gsb-pre-cleanups-redundant-requirements-rewrite
GSB: Preliminary cleanups before redundant requirement algorithm rewrite
2 parents 5cc451c + 64cc317 commit 7a15b7a

File tree

4 files changed

+163
-100
lines changed

4 files changed

+163
-100
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class GenericSignatureBuilder {
624624

625625
GenericSignature rebuildSignatureWithoutRedundantRequirements(
626626
bool allowConcreteGenericParams,
627-
bool buildingRequirementSignature) &&;
627+
const ProtocolDecl *requirementSignatureSelfProto) &&;
628628

629629
/// Finalize the set of requirements and compute the generic
630630
/// signature.
@@ -633,7 +633,7 @@ class GenericSignatureBuilder {
633633
/// generic signature builder no longer has valid state.
634634
GenericSignature computeGenericSignature(
635635
bool allowConcreteGenericParams = false,
636-
bool buildingRequirementSignature = false,
636+
const ProtocolDecl *requirementSignatureSelfProto = nullptr,
637637
bool rebuildingWithoutRedundantConformances = false) &&;
638638

639639
/// Compute the requirement signature for the given protocol.
@@ -646,7 +646,8 @@ class GenericSignatureBuilder {
646646
/// \param allowConcreteGenericParams If true, allow generic parameters to
647647
/// be made concrete.
648648
void finalize(TypeArrayView<GenericTypeParamType> genericParams,
649-
bool allowConcreteGenericParams=false);
649+
bool allowConcreteGenericParams,
650+
const ProtocolDecl *requirementSignatureSelfProto);
650651

651652
public:
652653
/// Process any delayed requirements that can be handled now.
@@ -657,14 +658,12 @@ class GenericSignatureBuilder {
657658
bool isRedundantExplicitRequirement(const ExplicitRequirement &req) const;
658659

659660
private:
660-
void computeRedundantRequirements();
661+
void computeRedundantRequirements(const ProtocolDecl *requirementSignatureSelfProto);
661662

662663
void diagnoseRedundantRequirements() const;
663664

664665
void diagnoseConflictingConcreteTypeRequirements() const;
665666

666-
bool hasExplicitConformancesImpliedByConcrete() const;
667-
668667
/// Describes the relationship between a given constraint and
669668
/// the canonical constraint of the equivalence class.
670669
enum class ConstraintRelation {

0 commit comments

Comments
 (0)