Skip to content

Commit 7a593ce

Browse files
committed
[Sema] Teach LocalDiscriminatorsRequest about runtime attribute initializers
1 parent 932c6eb commit 7a593ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@ unsigned LocalDiscriminatorsRequest::evaluate(
337337
node = initInfo.getInitFromProjectedValue();
338338
break;
339339
}
340+
} else if (auto *runtimeAttrInit =
341+
dyn_cast<RuntimeAttributeInitializer>(dc)) {
342+
auto *attachedTo = runtimeAttrInit->getAttachedToDecl();
343+
auto generator = attachedTo->getRuntimeDiscoverableAttributeGenerator(
344+
runtimeAttrInit->getAttr());
345+
if (generator.second)
346+
node = generator.first;
340347
}
341348

342349
if (!node)

0 commit comments

Comments
 (0)