Skip to content

Commit 21313d4

Browse files
committed
ClangImporter: Don't call getDirectlyInheritedNominalTypeDecls() on a protocol
1 parent dde28e9 commit 21313d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5913,6 +5913,9 @@ SwiftDeclConverter::importSwiftNewtype(const clang::TypedefNameDecl *decl,
59135913
if (!proto)
59145914
return false;
59155915

5916+
if (auto *computedProto = dyn_cast<ProtocolDecl>(computedNominal)) {
5917+
return (computedProto == proto || computedProto->inheritsFrom(proto));
5918+
}
59165919
// Break circularity by only looking for declared conformances in the
59175920
// original module, or possibly its overlay.
59185921
if (conformsToProtocolInOriginalModule(computedNominal, proto)) {

0 commit comments

Comments
 (0)