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) {
25662566 D->getAttrs ().hasAttribute <InlinableAttr>())
25672567 return ;
25682568
2569+ if (auto *FD = dyn_cast<FuncDecl>(D)) {
2570+ // Don't add dynamic to defer bodies.
2571+ if (FD->isDeferBody ())
2572+ return ;
2573+ }
2574+
25692575 if (auto *VD = dyn_cast<VarDecl>(D)) {
25702576 // Don't turn stored into computed properties. This could conflict with
25712577 // exclusivity checking.
Original file line number Diff line number Diff line change @@ -356,3 +356,9 @@ func getsetX(_ x: Int) -> Int {
356356dynamic func funcWithDefaultArg( _ arg : String = String ( " hello " ) ) {
357357 print ( " hello " )
358358}
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