File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,12 @@ static bool usesFeatureBuiltinEmplaceTypedThrows(Decl *decl) {
466
466
}
467
467
468
468
static bool usesFeatureExecutionAttribute (Decl *decl) {
469
+ if (auto *ASD = dyn_cast<AbstractStorageDecl>(decl)) {
470
+ if (auto *getter = ASD->getAccessor (AccessorKind::Get))
471
+ return usesFeatureExecutionAttribute (getter);
472
+ return false ;
473
+ }
474
+
469
475
if (decl->getAttrs ().hasAttribute <ExecutionAttr>())
470
476
return true ;
471
477
Original file line number Diff line number Diff line change 6
6
// REQUIRES: swift_feature_ExecutionAttribute
7
7
8
8
public struct Test {
9
+ // CHECK: #if compiler(>=5.3) && $ExecutionAttribute
10
+ // CHECK-NEXT: @execution(caller) public init() async
11
+ // CHECK-NEXT: #else
12
+ // CHECK-NEXT: public init() async
13
+ // CHECK-NEXT: #endif
14
+ @execution ( caller)
15
+ public init ( ) async {
16
+ }
17
+
9
18
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
10
19
// CHECK-NEXT: @execution(concurrent) public func test() async
11
20
// CHECK-NEXT: #else
@@ -21,5 +30,37 @@ public struct Test {
21
30
// CHECK-NEXT: public func other(_: () async -> Swift.Void)
22
31
// CHECK-NEXT: #endif
23
32
public func other( _: @execution ( caller) ( ) async -> Void ) { }
33
+
34
+ // CHECK: #if compiler(>=5.3) && $ExecutionAttribute
35
+ // CHECK-NEXT: public var test: Swift.Int {
36
+ // CHECK-NEXT: @execution(caller) get async
37
+ // CHECK-NEXT: }
38
+ // CHECK-NEXT: #else
39
+ // CHECK-NEXT: public var test: Swift.Int {
40
+ // CHECK-NEXT: get async
41
+ // CHECK-NEXT: }
42
+ // CHECK-NEXT: #endif
43
+ public var test : Int {
44
+ @execution ( caller)
45
+ get async {
46
+ 42
47
+ }
48
+ }
49
+
50
+ // CHECK: #if compiler(>=5.3) && $ExecutionAttribute
51
+ // CHECK-NEXT: public subscript(x: Swift.Int) -> Swift.Bool {
52
+ // CHECK-NEXT: @execution(caller) get async
53
+ // CHECK-NEXT: }
54
+ // CHECK-NEXT: #else
55
+ // CHECK-NEXT: public subscript(x: Swift.Int) -> Swift.Bool {
56
+ // CHECK-NEXT: get async
57
+ // CHECK-NEXT: }
58
+ // CHECK-NEXT: #endif
59
+ public subscript( x: Int ) -> Bool {
60
+ @execution ( caller)
61
+ get async {
62
+ false
63
+ }
64
+ }
24
65
}
25
66
You can’t perform that action at this time.
0 commit comments