Skip to content

Commit 1297e6b

Browse files
authored
---
yaml --- r: 348715 b: refs/heads/master c: 88ecae4 h: refs/heads/master i: 348713: c72e264 348711: d80c897
1 parent ab1fdd9 commit 1297e6b

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-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: 534781ef8c565932fe6988a77d6c6a42bf5c7a95
2+
refs/heads/master: 88ecae4b9a4a6bb8ae7ffcd389221708da50ac25
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/TypeCheckCaptures.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ class FindCapturedVars : public ASTWalker {
365365
return false;
366366
}
367367

368+
// Don't walk into local types; we'll walk their initializers when we check
369+
// the local type itself.
370+
if (isa<NominalTypeDecl>(D))
371+
return false;
372+
368373
return true;
369374
}
370375

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class C2 {
2+
public final func f() {
3+
func local() {
4+
_ = {
5+
class Local {
6+
lazy var a = {
7+
return b
8+
}()
9+
var b = 123
10+
}
11+
}
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-swift-emit-silgen -primary-file %s %S/Inputs/lazy_properties_other.swift -module-name lazy_properties_multi | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen %S/Inputs/lazy_properties_other.swift -primary-file %s -module-name lazy_properties_multi | %FileCheck %s
3+
// RUN: %target-swift-emit-silgen %S/Inputs/lazy_properties_other.swift %s -module-name lazy_properties_multi | %FileCheck %s
4+
// RUN: %target-swift-emit-silgen %s %S/Inputs/lazy_properties_other.swift -module-name lazy_properties_multi | %FileCheck %s
5+
6+
7+
public class C1 {
8+
// CHECK-LABEL: sil [ossa] @$s21lazy_properties_multi2C1C1f1cyAA2C2C_tF : $@convention(method) (@guaranteed C2, @guaranteed C1) -> () {
9+
// CHECK: [[FN:%.*]] = function_ref @$s21lazy_properties_multi2C2C1fyyF : $@convention(method) (@guaranteed C2)
10+
// CHECK: apply [[FN]](%0) : $@convention(method) (@guaranteed C2) -> ()
11+
public func f(c: C2) {
12+
c.f()
13+
}
14+
}

0 commit comments

Comments
 (0)