mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Simplify some code found by Slava, NFC.
This commit is contained in:
@@ -60,15 +60,8 @@ static Type findBaseTypeForReplacingArchetype(const ValueDecl *VD, const Type Ty
|
||||
return Type();
|
||||
|
||||
// Find the nominal type decl related to VD.
|
||||
auto TC = VD->getDeclContext()->getInnermostTypeContext();
|
||||
NominalTypeDecl *NTD = dyn_cast_or_null<NominalTypeDecl>(TC);
|
||||
if (!NTD) {
|
||||
ExtensionDecl *ED = dyn_cast_or_null<ExtensionDecl>(TC);
|
||||
if (ED) {
|
||||
if (auto T = ED->getExtendedType())
|
||||
NTD = T->getAnyNominal();
|
||||
}
|
||||
}
|
||||
NominalTypeDecl *NTD = VD->getDeclContext()->
|
||||
isNominalTypeOrNominalTypeExtensionContext();
|
||||
if (!NTD)
|
||||
return Type();
|
||||
Type Result;
|
||||
|
||||
Reference in New Issue
Block a user