Skip to content

Commit 5689f65

Browse files
committed
Update DeclContext::getInnermostPropertyAccessorContext for accessors within SubscriptDecl
1 parent f1c4196 commit 5689f65

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AST/DeclContext.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ AccessorDecl *DeclContext::getInnermostPropertyAccessorContext() {
214214
return nullptr;
215215

216216
auto *storage = accessor->getStorage();
217-
if (isa<VarDecl>(storage) && storage->getDeclContext()->isTypeContext())
217+
if ((isa<VarDecl>(storage) || isa<SubscriptDecl>(storage)) &&
218+
storage->getDeclContext()->isTypeContext()) {
218219
return accessor;
220+
}
219221
}
220222
} while ((dc = dc->getParent()));
221223

0 commit comments

Comments
 (0)