Skip to content

Commit 337edbe

Browse files
committed
ClangImporter: Don't wrap protocol Self return in DynamicSelfType
1 parent 1ead8ea commit 337edbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4109,8 +4109,9 @@ namespace {
41094109
// If the method has a related result type that is representable
41104110
// in Swift as DynamicSelf, do so.
41114111
if (!prop && decl->hasRelatedResultType()) {
4112-
resultTy = DynamicSelfType::get(dc->getSelfInterfaceType(),
4113-
Impl.SwiftContext);
4112+
resultTy = dc->getSelfInterfaceType();
4113+
if (dc->getSelfClassDecl())
4114+
resultTy = DynamicSelfType::get(resultTy, Impl.SwiftContext);
41144115
isIUO = false;
41154116

41164117
OptionalTypeKind nullability = OTK_ImplicitlyUnwrappedOptional;

0 commit comments

Comments
 (0)