Skip to content

Commit 293440d

Browse files
committed
remove underscore from assume funcs
1 parent d0c68c0 commit 293440d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

stdlib/public/Concurrency/AssumeActorExecutor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Swift
2828
@available(SwiftStdlib 5.9, *) // FIXME: use @backDeploy(before: SwiftStdlib 5.9)
2929
@_unavailableFromAsync(message: "await the call to the @MainActor closure directly")
3030
public
31-
func _assumeOnMainActorExecutor<T>(
31+
func assumeOnMainActorExecutor<T>(
3232
_ operation: @MainActor () throws -> T,
3333
file: StaticString = #fileID, line: UInt = #line
3434
) rethrows -> T {
@@ -66,7 +66,7 @@ func _assumeOnMainActorExecutor<T>(
6666
@available(SwiftStdlib 5.9, *) // FIXME: use @backDeploy(before: SwiftStdlib 5.9)
6767
@_unavailableFromAsync(message: "express the closure as an explicit function declared on the specified 'actor' instead")
6868
public
69-
func _assumeOnActorExecutor<Act: Actor, T>(
69+
func assumeOnActorExecutor<Act: Actor, T>(
7070
_ actor: Act,
7171
_ operation: (isolated Act) throws -> T,
7272
file: StaticString = #fileID, line: UInt = #line

test/Concurrency/Runtime/actor_assume_executor.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import StdlibUnittest
1616

1717
func checkAssumeMainActor(echo: MainActorEcho) /* synchronous! */ {
1818
// Echo.get("any") // error: main actor isolated, cannot perform async call here
19-
_assumeOnMainActorExecutor {
19+
assumeOnMainActorExecutor {
2020
let input = "example"
2121
let got = echo.get(input)
2222
precondition(got == "example", "Expected echo to match \(input)")
@@ -40,7 +40,7 @@ actor MainFriend {
4040

4141
func checkAssumeSomeone(someone: Someone) /* synchronous */ {
4242
// someone.something // can't access, would need a hop but we can't
43-
_assumeOnActorExecutor(someone) { someone in
43+
assumeOnActorExecutor(someone) { someone in
4444
let something = someone.something
4545
let expected = "isolated something"
4646
precondition(something == expected, "expected '\(expected)', got: \(something)")
@@ -103,45 +103,45 @@ final class MainActorEcho {
103103
if #available(SwiftStdlib 5.9, *) {
104104
// === MainActor --------------------------------------------------------
105105

106-
tests.test("_assumeOnMainActorExecutor: assume the main executor, from 'main() async'") {
106+
tests.test("assumeOnMainActorExecutor: assume the main executor, from 'main() async'") {
107107
await checkAssumeMainActor(echo: echo)
108108
}
109109

110-
tests.test("_assumeOnMainActorExecutor: assume the main executor, from MainActor method") {
110+
tests.test("assumeOnMainActorExecutor: assume the main executor, from MainActor method") {
111111
await mainActorCallCheck(echo: echo)
112112
}
113113

114-
tests.test("_assumeOnMainActorExecutor: assume the main executor, from actor on MainActor executor") {
114+
tests.test("assumeOnMainActorExecutor: assume the main executor, from actor on MainActor executor") {
115115
await MainFriend().callCheck(echo: echo)
116116
}
117117

118-
tests.test("_assumeOnMainActorExecutor: wrongly assume the main executor, from actor on other executor") {
118+
tests.test("assumeOnMainActorExecutor: wrongly assume the main executor, from actor on other executor") {
119119
expectCrashLater(withMessage: "Incorrect actor executor assumption; Expected 'MainActor' executor.")
120120
await Someone().callCheckMainActor(echo: echo)
121121
}
122122

123123
// === some Actor -------------------------------------------------------
124124

125125
let someone = Someone()
126-
tests.test("_assumeOnActorExecutor: wrongly assume someone's executor, from 'main() async'") {
126+
tests.test("assumeOnActorExecutor: wrongly assume someone's executor, from 'main() async'") {
127127
expectCrashLater(withMessage: "Incorrect actor executor assumption; Expected same executor as a.Someone.")
128128
checkAssumeSomeone(someone: someone)
129129
}
130130

131-
tests.test("_assumeOnActorExecutor: wrongly assume someone's executor, from MainActor method") {
131+
tests.test("assumeOnActorExecutor: wrongly assume someone's executor, from MainActor method") {
132132
expectCrashLater(withMessage: "Incorrect actor executor assumption; Expected same executor as a.Someone.")
133133
checkAssumeSomeone(someone: someone)
134134
}
135135

136-
tests.test("_assumeOnActorExecutor: assume someone's executor, from Someone") {
136+
tests.test("assumeOnActorExecutor: assume someone's executor, from Someone") {
137137
await someone.callCheckSomeone()
138138
}
139139

140-
tests.test("_assumeOnActorExecutor: assume someone's executor, from actor on the Someone.unownedExecutor") {
140+
tests.test("assumeOnActorExecutor: assume someone's executor, from actor on the Someone.unownedExecutor") {
141141
await SomeonesFriend(someone: someone).callCheckSomeone()
142142
}
143143

144-
tests.test("_assumeOnActorExecutor: wrongly assume the main executor, from actor on other executor") {
144+
tests.test("assumeOnActorExecutor: wrongly assume the main executor, from actor on other executor") {
145145
expectCrashLater(withMessage: "Incorrect actor executor assumption; Expected same executor as a.Someone.")
146146
await CompleteStranger(someone: someone).callCheckSomeone()
147147
}

0 commit comments

Comments
 (0)