mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Add ExtensionDecl::getExtendedNominal().
Introduce ExtensionDecl::getExtendedNominal() to provide the nominal type declaration that the extension declaration extends. Move most of the existing callers of the callers to getExtendedType() over to getExtendedNominal(), because they don’t need the full type information. ExtensionDecl::getExtendedNominal() is itself not very interesting yet, because it depends on getExtendedType().
This commit is contained in:
@@ -159,7 +159,7 @@ UIdent UIdentVisitor::visitParamDecl(const ParamDecl *D) {
|
||||
|
||||
UIdent UIdentVisitor::visitExtensionDecl(const ExtensionDecl *D) {
|
||||
assert(!IsRef && "reference to an extension ?");
|
||||
if (NominalTypeDecl *NTD = D->getExtendedType()->getAnyNominal()) {
|
||||
if (NominalTypeDecl *NTD = D->getExtendedNominal()) {
|
||||
if (isa<StructDecl>(NTD))
|
||||
return KindDeclExtensionStruct;
|
||||
if (isa<ClassDecl>(NTD))
|
||||
|
||||
Reference in New Issue
Block a user