@@ -139,7 +139,7 @@ class RequirementSource : public llvm::FoldingSetNode {
139139 // / The actual storage, described by \c storageKind.
140140 union {
141141 // / The type representation descibing where the requirement came from.
142- TypeRepr *typeRepr;
142+ const TypeRepr *typeRepr;
143143
144144 // / Where a requirement came from.
145145 const RequirementRepr *requirementRepr;
@@ -194,7 +194,7 @@ class RequirementSource : public llvm::FoldingSetNode {
194194 }
195195
196196 RequirementSource (Kind kind, const RequirementSource *parent,
197- TypeRepr *typeRepr)
197+ const TypeRepr *typeRepr)
198198 : kind(kind), storageKind(StorageKind::TypeRepr), parent(parent) {
199199 assert ((static_cast <bool >(parent) != isRootKind (kind)) &&
200200 " Root RequirementSource should not have parent (or vice versa)" );
@@ -245,7 +245,7 @@ class RequirementSource : public llvm::FoldingSetNode {
245245 // / Retrieve a requirement source representing an explicit requirement
246246 // / stated in an 'inheritance' clause.
247247 static const RequirementSource *forExplicit (GenericSignatureBuilder &builder,
248- TypeRepr *typeRepr);
248+ const TypeRepr *typeRepr);
249249
250250 // / Retrieve a requirement source representing an explicit requirement
251251 // / stated in an 'where' clause.
@@ -256,7 +256,7 @@ class RequirementSource : public llvm::FoldingSetNode {
256256 // / inferred from some part of a generic declaration's signature, e.g., the
257257 // / parameter or result type of a generic function.
258258 static const RequirementSource *forInferred (GenericSignatureBuilder &builder,
259- TypeRepr *typeRepr);
259+ const TypeRepr *typeRepr);
260260
261261 // / Retrieve a requirement source representing the requirement signature
262262 // / computation for a protocol.
@@ -307,7 +307,7 @@ class RequirementSource : public llvm::FoldingSetNode {
307307 int compare (const RequirementSource *other) const ;
308308
309309 // / Retrieve the type representation for this requirement, if there is one.
310- TypeRepr *getTypeRepr () const {
310+ const TypeRepr *getTypeRepr () const {
311311 if (storageKind != StorageKind::TypeRepr) return nullptr ;
312312 return storage.typeRepr ;
313313 }
@@ -447,20 +447,11 @@ class GenericSignatureBuilder {
447447 Type T1, Type T2, const RequirementSource *Source,
448448 llvm::function_ref<void (Type, Type)> diagnoseMismatch);
449449
450- // / Add the requirements placed on the given abstract type parameter
450+ // / Add the requirements placed on the given type parameter
451451 // / to the given potential archetype.
452- bool addAbstractTypeParamRequirements (
453- AbstractTypeParamDecl *decl,
454- PotentialArchetype *pa,
455- const RequirementSource *source,
456- llvm::SmallPtrSetImpl<ProtocolDecl *> &visited);
457-
458- // / Visit all of the types that show up in the list of inherited
459- // / types.
460- // /
461- // / \returns true if any of the invocations of \c visitor returned true.
462- bool visitInherited (ArrayRef<TypeLoc> inheritedTypes,
463- llvm::function_ref<bool (Type, SourceLoc)> visitor);
452+ bool addInheritedRequirements (TypeDecl *decl, PotentialArchetype *pa,
453+ const RequirementSource *parentSource,
454+ llvm::SmallPtrSetImpl<ProtocolDecl *> &visited);
464455
465456 // / Visit all of the potential archetypes.
466457 template <typename F>
0 commit comments