-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathexecution_behavior_attrs.swift
42 lines (34 loc) · 1.17 KB
/
execution_behavior_attrs.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name execution_attr -enable-experimental-feature ExecutionAttribute
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name execution_attr
// RUN: %FileCheck %s --input-file %t.swiftinterface
// REQUIRES: swift_feature_ExecutionAttribute
public struct Test {
// CHECK: nonisolated(nonsending) public init() async
nonisolated(nonsending)
public init() async {
}
// CHECK: @concurrent public func test() async
@concurrent
public func test() async {
}
// CHECK: public func other(_: nonisolated(nonsending) () async -> Swift.Void)
public func other(_: nonisolated(nonsending) () async -> Void) {}
// CHECK: nonisolated(nonsending) public var testOnVar: Swift.Int {
// CHECK-NEXT: get async
// CHECK-NEXT: }
nonisolated(nonsending)
public var testOnVar: Int {
get async {
42
}
}
// CHECK: nonisolated(nonsending) public subscript(onSubscript _: Swift.Int) -> Swift.Bool {
// CHECK-NEXT: get async
// CHECK-NEXT: }
nonisolated(nonsending)
public subscript(onSubscript _: Int) -> Bool {
get async {
false
}
}
}