mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[NFC] Adopt TypeBase-isms for GenericSignature
Structurally prevent a number of common anti-patterns involving generic signatures by separating the interface into GenericSignature and the implementation into GenericSignatureBase. In particular, this allows the comparison operators to be deleted which forces callers to canonicalize the signature or ask to compare pointers explicitly.
This commit is contained in:
@@ -66,7 +66,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
|
||||
|
||||
/// Returns true if \p paramTy has any constraints other than being
|
||||
/// class-bound ("conforms to" AnyObject).
|
||||
static bool isConstrained(GenericSignature *sig,
|
||||
static bool isConstrained(GenericSignature sig,
|
||||
GenericTypeParamType *paramTy) {
|
||||
if (sig->getSuperclassBound(paramTy))
|
||||
return true;
|
||||
@@ -83,7 +83,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
|
||||
NeedsDefinition = false;
|
||||
|
||||
bool isObjCGeneric = decl->hasClangNode();
|
||||
auto *sig = decl->getGenericSignature();
|
||||
auto sig = decl->getGenericSignature();
|
||||
|
||||
for_each(boundGeneric->getGenericArgs(),
|
||||
sig->getInnermostGenericParams(),
|
||||
@@ -587,4 +587,4 @@ swift::printModuleContentsAsObjC(raw_ostream &os,
|
||||
llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
|
||||
ModuleDecl &M, AccessLevel minRequiredAccess) {
|
||||
ModuleWriter(os, imports, M, minRequiredAccess).write();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user