[Frontend] Hide @execution attribute behind an experimental feature ExecutionAttribute

Since the proposal has not been approved yet we cannot expose
`@execution` attribute.
This commit is contained in:
Pavel Yaskevich
2025-02-19 19:53:19 -08:00
parent e2ff3308be
commit dd1be8f6d4
19 changed files with 144 additions and 18 deletions

View File

@@ -0,0 +1,25 @@
// 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: #if compiler(>=5.3) && $ExecutionAttribute
// CHECK-NEXT: @execution(concurrent) public func test() async
// CHECK-NEXT: #else
// CHECK-NEXT: public func test() async
// CHECK-NEXT: #endif
@execution(concurrent)
public func test() async {
}
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
// CHECK-NEXT: public func other(_: @execution(caller) () async -> Swift.Void)
// CHECK-NEXT: #else
// CHECK-NEXT: public func other(_: () async -> Swift.Void)
// CHECK-NEXT: #endif
public func other(_: @execution(caller) () async -> Void) {}
}