Skip to content

[GSB] Reduce dependence on potential archetypes for rewrite tree #15172

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions include/swift/AST/GenericSignatureBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,19 +445,16 @@ class GenericSignatureBuilder {
/// Note that we have added the nested type nestedPA
void addedNestedType(PotentialArchetype *nestedPA);

/// Add a rewrite rule that makes \c otherPA a part of the given equivalence
/// class.
/// Add a rewrite rule from that makes the two types equivalent.
///
/// \returns true if a new rewrite rule was added, and false otherwise.
bool addSameTypeRewriteRule(EquivalenceClass *equivClass,
PotentialArchetype *otherPA);
bool addSameTypeRewriteRule(CanType type1, CanType type2);

/// \brief Add a new conformance requirement specifying that the given
/// potential archetypes are equivalent.
ConstraintResult addSameTypeRequirementBetweenArchetypes(
PotentialArchetype *T1,
PotentialArchetype *T2,
const RequirementSource *Source);
/// \brief Add a same-type requirement between two types that are known to
/// refer to type parameters.
ConstraintResult addSameTypeRequirementBetweenTypeParameters(
ResolvedType type1, ResolvedType type2,
const RequirementSource *source);

/// \brief Add a new conformance requirement specifying that the given
/// potential archetype is bound to a concrete type.
Expand Down Expand Up @@ -811,9 +808,6 @@ class GenericSignatureBuilder {
bool areInSameEquivalenceClass(Type type1, Type type2);

/// Simplify the given dependent type down to its canonical representation.
///
/// \returns null if the type involved dependent member types that
/// don't have associated types.
Type getCanonicalTypeParameter(Type type);

/// For each requirement in \c sig, create a new signature without it and see
Expand Down
Loading