Skip to content

Commit 9823d16

Browse files
committed
AST: Fix Decl::getInnermostDeclContext()
This wasn't doing the right thing for TypeAliasDecls. NFC for now, but exposed by some other changes I am working on.
1 parent af1defc commit 9823d16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ llvm::raw_ostream &swift::operator<<(llvm::raw_ostream &OS,
286286
DeclContext *Decl::getInnermostDeclContext() const {
287287
if (auto func = dyn_cast<AbstractFunctionDecl>(this))
288288
return const_cast<AbstractFunctionDecl*>(func);
289-
if (auto nominal = dyn_cast<NominalTypeDecl>(this))
290-
return const_cast<NominalTypeDecl*>(nominal);
289+
if (auto nominal = dyn_cast<GenericTypeDecl>(this))
290+
return const_cast<GenericTypeDecl*>(nominal);
291291
if (auto ext = dyn_cast<ExtensionDecl>(this))
292292
return const_cast<ExtensionDecl*>(ext);
293293
if (auto topLevel = dyn_cast<TopLevelCodeDecl>(this))

0 commit comments

Comments
 (0)