mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Lift Requirement and Parameter Accessors up to GenericSignature
Start treating the null {Can}GenericSignature as a regular signature
with no requirements and no parameters. This not only makes for a much
safer abstraction, but allows us to simplify a lot of the clients of
GenericSignature that would previously have to check for null before
using the abstraction.
This commit is contained in:
@@ -290,7 +290,7 @@ static void initDocGenericParams(const Decl *D, DocEntityInfo &Info,
|
||||
|
||||
// FIXME: Not right for extensions of nested generic types
|
||||
if (GC->isGeneric()) {
|
||||
for (auto *GP : GenericSig->getInnermostGenericParams()) {
|
||||
for (auto *GP : GenericSig.getInnermostGenericParams()) {
|
||||
if (GP->getDecl()->isImplicit())
|
||||
continue;
|
||||
Type TypeToPrint = GP;
|
||||
@@ -314,7 +314,7 @@ static void initDocGenericParams(const Decl *D, DocEntityInfo &Info,
|
||||
if (auto *typeDC = GC->getInnermostTypeContext())
|
||||
Proto = typeDC->getSelfProtocolDecl();
|
||||
|
||||
for (auto Req: GenericSig->getRequirements()) {
|
||||
for (auto Req: GenericSig.getRequirements()) {
|
||||
if (Proto &&
|
||||
Req.getKind() == RequirementKind::Conformance &&
|
||||
Req.getFirstType()->isEqual(Proto->getSelfInterfaceType()) &&
|
||||
|
||||
Reference in New Issue
Block a user