mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Introduce abstraction for extension/type decl inheritance clauses.
Wrap the `InheritedEntry` array available on both `ExtensionDecl` and `TypeDecl` in a new `InheritedTypes` class. This class will provide shared conveniences for working with inherited type clauses. NFC.
This commit is contained in:
@@ -623,7 +623,7 @@ static void reportRelated(ASTContext &Ctx, const Decl *D,
|
||||
passExtends(TD, Consumer);
|
||||
}
|
||||
|
||||
passInherits(ED->getInherited(), Consumer);
|
||||
passInherits(ED->getInherited().getEntries(), Consumer);
|
||||
|
||||
} else if (auto *TAD = dyn_cast<TypeAliasDecl>(D)) {
|
||||
|
||||
@@ -631,7 +631,7 @@ static void reportRelated(ASTContext &Ctx, const Decl *D,
|
||||
// If underlying type exists, report the inheritance and conformance of the
|
||||
// underlying type.
|
||||
if (auto NM = Ty->getAnyNominal()) {
|
||||
passInherits(NM->getInherited(), Consumer);
|
||||
passInherits(NM->getInherited().getEntries(), Consumer);
|
||||
passConforms(NM->getSatisfiedProtocolRequirements(/*Sorted=*/true),
|
||||
Consumer);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user