mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -264,7 +264,7 @@ static void initDocGenericParams(const Decl *D, DocEntityInfo &Info) {
|
||||
if (DC == nullptr || !DC->isInnermostContextGeneric())
|
||||
return;
|
||||
|
||||
GenericSignature *GenericSig = DC->getGenericSignatureOfContext();
|
||||
GenericSignature GenericSig = DC->getGenericSignatureOfContext();
|
||||
|
||||
if (!GenericSig)
|
||||
return;
|
||||
@@ -401,7 +401,7 @@ static bool initDocEntityInfo(const Decl *D,
|
||||
else
|
||||
SwiftLangSupport::printFullyAnnotatedDeclaration(VD, Type(), OS);
|
||||
} else if (auto *E = dyn_cast<ExtensionDecl>(D)) {
|
||||
if (auto *Sig = E->getGenericSignature()) {
|
||||
if (auto Sig = E->getGenericSignature()) {
|
||||
// The extension under printing is potentially part of a synthesized
|
||||
// extension. Thus it's hard to print the fully annotated decl. We
|
||||
// need to at least print the generic signature here.
|
||||
|
||||
Reference in New Issue
Block a user