File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2566,6 +2566,12 @@ void TypeChecker::addImplicitDynamicAttribute(Decl *D) {
2566
2566
D->getAttrs ().hasAttribute <InlinableAttr>())
2567
2567
return ;
2568
2568
2569
+ if (auto *FD = dyn_cast<FuncDecl>(D)) {
2570
+ // Don't add dynamic to defer bodies.
2571
+ if (FD->isDeferBody ())
2572
+ return ;
2573
+ }
2574
+
2569
2575
if (auto *VD = dyn_cast<VarDecl>(D)) {
2570
2576
// Don't turn stored into computed properties. This could conflict with
2571
2577
// exclusivity checking.
Original file line number Diff line number Diff line change @@ -356,3 +356,9 @@ func getsetX(_ x: Int) -> Int {
356
356
dynamic func funcWithDefaultArg( _ arg : String = String ( " hello " ) ) {
357
357
print ( " hello " )
358
358
}
359
+
360
+ // IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable6$deferL_yyF
361
+ var x = 10
362
+ defer {
363
+ let y = x
364
+ }
You can’t perform that action at this time.
0 commit comments