Skip to content

Commit 629d708

Browse files
committed
[Concurrency] Add more availability tests.
Some additional availability tests required.
1 parent 844130f commit 629d708

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

stdlib/public/Concurrency/ExecutorImpl.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,22 @@ internal func donateToGlobalExecutor(
5555
@available(SwiftStdlib 6.2, *)
5656
@_silgen_name("swift_task_getMainExecutorImpl")
5757
internal func getMainExecutor() -> UnownedSerialExecutor {
58-
return unsafe _getMainExecutorAsSerialExecutor()
58+
if #available(StdlibDeploymentTarget 6.3, *) {
59+
return unsafe _getMainExecutorAsSerialExecutor()
60+
} else {
61+
fatalError("this should never happen")
62+
}
5963
}
6064

6165
@available(SwiftStdlib 6.2, *)
6266
@_silgen_name("swift_task_enqueueMainExecutorImpl")
6367
internal func enqueueOnMainExecutor(job unownedJob: UnownedJob) {
6468
#if !SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
65-
MainActor.executor.enqueue(unownedJob)
69+
if #available(StdlibDeploymentTarget 6.3, *) {
70+
MainActor.executor.enqueue(unownedJob)
71+
} else {
72+
fatalError("this should never happen")
73+
}
6674
#else
6775
fatalError("swift_task_enqueueMainExecutor() not supported for task-to-thread")
6876
#endif

0 commit comments

Comments
 (0)