Skip to content

Commit 8ade928

Browse files
committed
Simplify some code found by Slava, NFC.
1 parent 529b386 commit 8ade928

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ static Type findBaseTypeForReplacingArchetype(const ValueDecl *VD, const Type Ty
6060
return Type();
6161

6262
// Find the nominal type decl related to VD.
63-
auto TC = VD->getDeclContext()->getInnermostTypeContext();
64-
NominalTypeDecl *NTD = dyn_cast_or_null<NominalTypeDecl>(TC);
65-
if (!NTD) {
66-
ExtensionDecl *ED = dyn_cast_or_null<ExtensionDecl>(TC);
67-
if (ED) {
68-
if (auto T = ED->getExtendedType())
69-
NTD = T->getAnyNominal();
70-
}
71-
}
63+
NominalTypeDecl *NTD = VD->getDeclContext()->
64+
isNominalTypeOrNominalTypeExtensionContext();
7265
if (!NTD)
7366
return Type();
7467
Type Result;

0 commit comments

Comments
 (0)