mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST/ASTGen/Sema/Serialization] Remove @execution attribute
Complete the transition from `@execution` to `@concurrent` and `nonisolated(nonsending)`
This commit is contained in:
@@ -91,6 +91,6 @@ public struct MutatingTest {
|
||||
public func testExecutionConcurrent() async {}
|
||||
// CHECK: @concurrent public func testExecutionConcurrent() async
|
||||
|
||||
@execution(caller)
|
||||
nonisolated(nonsending)
|
||||
public func testExecutionCaller() async {}
|
||||
// CHECK: @execution(caller) public func testExecutionCaller() async
|
||||
// CHECK: nonisolated(nonsending) public func testExecutionCaller() async
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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(caller) public init() async
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: public init() async
|
||||
// CHECK-NEXT: #endif
|
||||
@execution(caller)
|
||||
public init() async {
|
||||
}
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
|
||||
// CHECK-NEXT: @concurrent public func test() async
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: public func test() async
|
||||
// CHECK-NEXT: #endif
|
||||
@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) {}
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
|
||||
// CHECK-NEXT: @execution(caller) public var testOnVar: Swift.Int {
|
||||
// CHECK-NEXT: get async
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: public var testOnVar: Swift.Int {
|
||||
// CHECK-NEXT: get async
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #endif
|
||||
@execution(caller)
|
||||
public var testOnVar: Int {
|
||||
get async {
|
||||
42
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $ExecutionAttribute
|
||||
// CHECK-NEXT: @execution(caller) public subscript(onSubscript _: Swift.Int) -> Swift.Bool {
|
||||
// CHECK-NEXT: get async
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: public subscript(onSubscript _: Swift.Int) -> Swift.Bool {
|
||||
// CHECK-NEXT: get async
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #endif
|
||||
@execution(caller)
|
||||
public subscript(onSubscript _: Int) -> Bool {
|
||||
get async {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
42
test/ModuleInterface/execution_behavior_attrs.swift
Normal file
42
test/ModuleInterface/execution_behavior_attrs.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user