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:
@@ -3801,9 +3801,9 @@ public:
|
||||
/// Add all of the inherited entries to the result vector.
|
||||
///
|
||||
/// \returns the number of entries added.
|
||||
size_t addInherited(ArrayRef<InheritedEntry> inheritedEntries,
|
||||
size_t addInherited(InheritedTypes inheritedEntries,
|
||||
SmallVectorImpl<TypeID> &result) {
|
||||
for (const auto &inherited : inheritedEntries) {
|
||||
for (const auto &inherited : inheritedEntries.getEntries()) {
|
||||
assert(!inherited.getType() || !inherited.getType()->hasArchetype());
|
||||
TypeID typeRef = S.addTypeRef(inherited.getType());
|
||||
|
||||
@@ -4218,7 +4218,7 @@ public:
|
||||
proto->getInherited(), inheritedAndDependencyTypes);
|
||||
|
||||
// Separately collect inherited protocol types as dependencies.
|
||||
for (auto element : proto->getInherited()) {
|
||||
for (auto element : proto->getInherited().getEntries()) {
|
||||
auto elementType = element.getType();
|
||||
assert(!elementType || !elementType->hasArchetype());
|
||||
if (elementType &&
|
||||
|
||||
Reference in New Issue
Block a user