Skip to content

Commit ae2cdfc

Browse files
authored
Merge pull request #15172 from DougGregor/gsb-weaken-potential-archetypes
[GSB] Reduce dependence on potential archetypes for rewrite tree
2 parents b285f5d + 4481a42 commit ae2cdfc

File tree

2 files changed

+111
-148
lines changed

2 files changed

+111
-148
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -445,19 +445,16 @@ class GenericSignatureBuilder {
445445
/// Note that we have added the nested type nestedPA
446446
void addedNestedType(PotentialArchetype *nestedPA);
447447

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

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

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

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

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

0 commit comments

Comments
 (0)