File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2457,6 +2457,21 @@ void TypeChecker::addImplicitDynamicAttribute(Decl *D) {
2457
2457
isa<AccessorDecl>(D))
2458
2458
return ;
2459
2459
2460
+ if (D->getAttrs ().hasAttribute <FinalAttr>() ||
2461
+ D->getAttrs ().hasAttribute <NonObjCAttr>() ||
2462
+ D->getAttrs ().hasAttribute <TransparentAttr>() ||
2463
+ D->getAttrs ().hasAttribute <InlinableAttr>())
2464
+ return ;
2465
+
2466
+ if (auto *VD = dyn_cast<VarDecl>(D)) {
2467
+ // Don't add dynamic to local variables.
2468
+ if (VD->getDeclContext ()->isLocalContext ())
2469
+ return ;
2470
+ // Don't add to implicit variables.
2471
+ if (VD->isImplicit ())
2472
+ return ;
2473
+ }
2474
+
2460
2475
if (!D->getAttrs ().hasAttribute <DynamicAttr>() &&
2461
2476
!D->getAttrs ().hasAttribute <DynamicReplacementAttr>()) {
2462
2477
auto attr = new (D->getASTContext ()) DynamicAttr (/* implicit=*/ true );
You can’t perform that action at this time.
0 commit comments