Skip to content

Commit 16f97c5

Browse files
committed
IDE: Use getAllInheritedProtocols()
1 parent 8702101 commit 16f97c5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/IDE/CodeCompletionResultType.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,16 @@ const USRBasedType *USRBasedType::fromType(Type Ty, USRBasedTypeArena &Arena) {
228228
;
229229
if (auto Nominal = Ty->getAnyNominal()) {
230230
if (auto *Proto = dyn_cast<ProtocolDecl>(Nominal)) {
231-
Proto->walkInheritedProtocols([&](ProtocolDecl *inherited) {
232-
if (Proto != inherited &&
233-
!inherited->isSpecificProtocol(KnownProtocolKind::Sendable) &&
231+
for (auto *inherited : Proto->getAllInheritedProtocols()) {
232+
if (!inherited->isSpecificProtocol(KnownProtocolKind::Sendable) &&
234233
!inherited->getInvertibleProtocolKind()) {
235234
LLVM_DEBUG(llvm::dbgs() << "Adding inherited protocol "
236235
<< inherited->getName()
237236
<< "\n";);
238237
Supertypes.push_back(USRBasedType::fromType(
239238
inherited->getDeclaredInterfaceType(), Arena));
240239
}
241-
242-
return TypeWalker::Action::Continue;
243-
});
240+
}
244241
} else {
245242
auto Conformances = Nominal->getAllConformances();
246243
Supertypes.reserve(Conformances.size());

0 commit comments

Comments
 (0)