mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
If you use SwiftStdlibCurrentOS availability, you will be able to use new types and functions from within the implementation. This works by, when appropriate, building with the CurrentOS availability set to the current deployment target. rdar://150944675
This commit is contained in:
@@ -26,10 +26,12 @@ final class OldExecutorOldStdlib: SerialExecutor {
|
||||
/// availability, since in this case the UnownedJob version needs to exist.
|
||||
@available(SwiftStdlib 5.1, *)
|
||||
final class BothExecutorOldStdlib: SerialExecutor {
|
||||
func enqueue(_ job: UnownedJob) {} // expected-note{{'enqueue' declared here}}
|
||||
func enqueue(_ job: UnownedJob) {}
|
||||
|
||||
// This no longer warns, because of the use of SwiftStdlibCurrentOS in the
|
||||
// runtime.
|
||||
@available(SwiftStdlib 5.9, *)
|
||||
func enqueue(_ job: __owned ExecutorJob) {} // expected-warning{{'Executor.enqueue(ExecutorJob)' will never be used, due to the presence of 'enqueue(UnownedJob)'}}
|
||||
func enqueue(_ job: __owned ExecutorJob) {}
|
||||
|
||||
func asUnownedSerialExecutor() -> UnownedSerialExecutor {
|
||||
UnownedSerialExecutor(ordinary: self)
|
||||
|
||||
Reference in New Issue
Block a user