Skip to content

Commit 19cdbda

Browse files
authored
Merge pull request #15199 from DougGregor/gsb-same-type-without-potential-archetypes
[GSB] Eliminate potential archetypes from the same-type constraint representation
2 parents a03ed43 + 31792ac commit 19cdbda

File tree

2 files changed

+109
-83
lines changed

2 files changed

+109
-83
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class GenericSignatureBuilder {
124124
conformsTo;
125125

126126
/// Same-type constraints within this equivalence class.
127-
std::vector<Constraint<PotentialArchetype *>> sameTypeConstraints;
127+
std::vector<Constraint<Type>> sameTypeConstraints;
128128

129129
/// Concrete type to which this equivalence class is equal.
130130
///
@@ -213,15 +213,6 @@ class GenericSignatureBuilder {
213213
ProtocolDecl *proto,
214214
FloatingRequirementSource source);
215215

216-
/// Record a same-type constraint between \c type1 and \c type2 determined
217-
/// via the given source.
218-
///
219-
/// \returns true if this same-type constraint merges two equivalence
220-
/// classes, and false otherwise.
221-
bool recordSameTypeConstraint(PotentialArchetype *type1,
222-
PotentialArchetype *type2,
223-
const RequirementSource *source);
224-
225216
/// Find a source of the same-type constraint that maps a potential
226217
/// archetype in this equivalence class to a concrete type along with
227218
/// that concrete type as written.
@@ -1505,8 +1496,10 @@ struct GenericSignatureBuilder::Constraint {
15051496
Type getSubjectDependentType(
15061497
TypeArrayView<GenericTypeParamType> genericParams) const;
15071498

1508-
/// Determine whether the subject is equivalence to the given potential
1509-
/// archetype.
1499+
/// Determine whether the subject is equivalence to the given type.
1500+
bool isSubjectEqualTo(Type type) const;
1501+
1502+
/// Determine whether the subject is equivalence to the given type.
15101503
bool isSubjectEqualTo(const PotentialArchetype *pa) const;
15111504

15121505
/// Determine whether this constraint has the same subject as the

0 commit comments

Comments
 (0)