mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -620,17 +620,6 @@ SelfBounds getSelfBoundsFromWhereClause(
|
||||
/// given protocol or protocol extension.
|
||||
SelfBounds getSelfBoundsFromGenericSignature(const ExtensionDecl *extDecl);
|
||||
|
||||
/// Retrieve the TypeLoc at the given \c index from among the set of
|
||||
/// type declarations that are directly "inherited" by the given declaration.
|
||||
inline const TypeLoc &getInheritedTypeLocAtIndex(
|
||||
llvm::PointerUnion<const TypeDecl *, const ExtensionDecl *> decl,
|
||||
unsigned index) {
|
||||
if (auto typeDecl = decl.dyn_cast<const TypeDecl *>())
|
||||
return typeDecl->getInherited()[index];
|
||||
|
||||
return decl.get<const ExtensionDecl *>()->getInherited()[index];
|
||||
}
|
||||
|
||||
namespace namelookup {
|
||||
|
||||
/// Searches through statements and patterns for local variable declarations.
|
||||
|
||||
Reference in New Issue
Block a user