Skip to content

Commit 84764de

Browse files
committed
[Concurrency] Fix code completion test given new actor method
1 parent 20fe3b0 commit 84764de

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

stdlib/public/Concurrency/Executor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extension Actor {
102102
/// of the executor while performing the operation.
103103
@_alwaysEmitIntoClient
104104
@available(SwiftStdlib 5.1, *)
105-
public nonisolated func withSerialExecutor<T>(_ operation: (any SerialExecutor) throws -> T) rethrows -> T {
105+
public nonisolated func withSerialExecutor<T, E: Error>(_ operation: (any SerialExecutor) throws(E) -> T) throws(E) -> T {
106106
try operation(unsafe unsafeBitCast(self.unownedExecutor, to: (any SerialExecutor).self))
107107
}
108108

@@ -113,7 +113,7 @@ extension Actor {
113113
/// of the executor while performing the operation.
114114
@_alwaysEmitIntoClient
115115
@available(SwiftStdlib 5.1, *)
116-
public nonisolated func withSerialExecutor<T>(_ operation: (any SerialExecutor) async throws -> T) async rethrows -> T {
116+
public nonisolated func withSerialExecutor<T, E: Error>(_ operation: (any SerialExecutor) async throws(E) -> T) async throws(E) -> T {
117117
try await operation(unsafe unsafeBitCast(self.unownedExecutor, to: (any SerialExecutor).self))
118118
}
119119
}

test/IDE/complete_cache_notrecommended.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ func testAsync() async -> Int {
3232
}
3333
func testSyncMember(obj: MyActor) -> Int {
3434
obj.#^MEMBER_IN_SYNC^#
35-
// MEMBER_IN_SYNC: Begin completions, 9 items
35+
// MEMBER_IN_SYNC: Begin completions, 11 items
3636
// MEMBER_IN_SYNC-DAG: Keyword[self]/CurrNominal: self[#MyActor#];
3737
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/CurrNominal/TypeRelation[Convertible]: actorMethod()[' async'][#Int#];
3838
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/CurrNominal/NotRecommended: deprecatedMethod()[' async'][#Void#];
3939
// MEMBER_IN_SYNC-DAG: Decl[InstanceVar]/CurrNominal: unownedExecutor[#UnownedSerialExecutor#];
40+
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: withSerialExecutor({#(operation): (any SerialExecutor) throws -> T##(any SerialExecutor) throws -> T#})[' rethrows'][#T#]; name=withSerialExecutor(:)
41+
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: withSerialExecutor({#(operation): (any SerialExecutor) async throws -> T##(any SerialExecutor) async throws -> T#})[' async'][' rethrows'][#T#]; name=withSerialExecutor(:)
4042
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: preconditionIsolated()[#Void#]; name=preconditionIsolated()
4143
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: preconditionIsolated({#(message): String#})[#Void#]; name=preconditionIsolated(:)
4244
// MEMBER_IN_SYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: assertIsolated()[#Void#]; name=assertIsolated()
@@ -46,11 +48,13 @@ func testSyncMember(obj: MyActor) -> Int {
4648

4749
func testSyncMember(obj: MyActor) async -> Int {
4850
obj.#^MEMBER_IN_ASYNC^#
49-
// MEMBER_IN_ASYNC: Begin completions, 9 items
51+
// MEMBER_IN_ASYNC: Begin completions, 11 items
5052
// MEMBER_IN_ASYNC-DAG: Keyword[self]/CurrNominal: self[#MyActor#];
5153
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/CurrNominal/TypeRelation[Convertible]: actorMethod()[' async'][#Int#];
5254
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/CurrNominal/NotRecommended: deprecatedMethod()[' async'][#Void#];
5355
// MEMBER_IN_ASYNC-DAG: Decl[InstanceVar]/CurrNominal: unownedExecutor[#UnownedSerialExecutor#];
56+
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: withSerialExecutor({#(operation): (any SerialExecutor) throws -> T##(any SerialExecutor) throws -> T#})[' rethrows'][#T#]; name=withSerialExecutor(:)
57+
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: withSerialExecutor({#(operation): (any SerialExecutor) async throws -> T##(any SerialExecutor) async throws -> T#})[' async'][' rethrows'][#T#]; name=withSerialExecutor(:)
5458
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: preconditionIsolated()[#Void#]; name=preconditionIsolated()
5559
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: preconditionIsolated({#(message): String#})[#Void#]; name=preconditionIsolated(:)
5660
// MEMBER_IN_ASYNC-DAG: Decl[InstanceMethod]/Super/IsSystem: assertIsolated()[#Void#]; name=assertIsolated()

0 commit comments

Comments
 (0)