Skip to content

Commit c0db8b7

Browse files
committed
---
yaml --- r: 347252 b: refs/heads/master c: c9c9fd3 h: refs/heads/master
1 parent 0820573 commit c0db8b7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 30ef34e46626bb9a364e107399c2ff831cf5f8d1
2+
refs/heads/master: c9c9fd34975bd0a5cd1410334c06d6e7e2b8f610
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/Sema/TypeCheckAttr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

trunk/test/SILGen/dynamically_replaceable.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,9 @@ func getsetX(_ x: Int) -> Int {
356356
dynamic 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+
}

0 commit comments

Comments
 (0)