Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSB: Preliminary cleanups before redundant requirement algorithm rewrite #37157

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions include/swift/AST/GenericSignatureBuilder.h
Expand Up @@ -624,7 +624,7 @@ class GenericSignatureBuilder {

GenericSignature rebuildSignatureWithoutRedundantRequirements(
bool allowConcreteGenericParams,
bool buildingRequirementSignature) &&;
const ProtocolDecl *requirementSignatureSelfProto) &&;

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

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

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

private:
void computeRedundantRequirements();
void computeRedundantRequirements(const ProtocolDecl *requirementSignatureSelfProto);

void diagnoseRedundantRequirements() const;

void diagnoseConflictingConcreteTypeRequirements() const;

bool hasExplicitConformancesImpliedByConcrete() const;

/// Describes the relationship between a given constraint and
/// the canonical constraint of the equivalence class.
enum class ConstraintRelation {
Expand Down