Skip to content

Commit bd2bee7

Browse files
committed
[IRGen/TBDGen] Minor fixes for opaque result types.
Fixes rdar://problem/50001229.
1 parent f0a3b8b commit bd2bee7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,8 +2161,7 @@ void IRGenModule::emitOpaqueTypeDescriptorAccessor(OpaqueTypeDecl *opaque) {
21612161
auto accessor =
21622162
getAddrOfOpaqueTypeDescriptorAccessFunction(opaque, ForDefinition, false);
21632163

2164-
if (cast<AbstractFunctionDecl>(opaque->getNamingDecl())
2165-
->isNativeDynamic()) {
2164+
if (opaque->getNamingDecl()->isNativeDynamic()) {
21662165
auto thunk = accessor;
21672166
auto impl =
21682167
getAddrOfOpaqueTypeDescriptorAccessFunction(opaque, ForDefinition, true);

lib/TBDGen/TBDGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ void TBDGenVisitor::visitAbstractStorageDecl(AbstractStorageDecl *ASD) {
267267
// ...and the opaque result decl if it has one.
268268
if (auto opaqueResult = ASD->getOpaqueResultTypeDecl()) {
269269
addSymbol(LinkEntity::forOpaqueTypeDescriptor(opaqueResult));
270+
addSymbol(LinkEntity::forOpaqueTypeDescriptorAccessor(opaqueResult));
270271
}
271272

272273
// Explicitly look at each accessor here: see visitAccessorDecl.

0 commit comments

Comments
 (0)