From e5eb2bcdf66cf2b7bc7e359214c12d613e22b5d0 Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Mon, 17 Apr 2023 19:44:12 +0900 Subject: [PATCH] [Concurrency] Re-enable test on iOS platform: enqueue impls --- test/Concurrency/custom_executor_enqueue_impls.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/Concurrency/custom_executor_enqueue_impls.swift b/test/Concurrency/custom_executor_enqueue_impls.swift index 46db955cced2f..c0e77e0b9c502 100644 --- a/test/Concurrency/custom_executor_enqueue_impls.swift +++ b/test/Concurrency/custom_executor_enqueue_impls.swift @@ -1,16 +1,14 @@ -// RUN: %target-typecheck-verify-swift -enable-experimental-move-only -disable-availability-checking +// RUN: %target-typecheck-verify-swift -enable-experimental-move-only // REQUIRES: concurrency // rdar://106849189 move-only types should be supported in freestanding mode // UNSUPPORTED: freestanding -// FIXME: rdar://107112715 test failing on iOS simulator, investigating -// UNSUPPORTED: OS=ios - // Such type may be encountered since Swift 5.5 (5.1 backdeployed) if someone implemented the // not documented, but public Executor types back then already. // // We keep support for them, but also log a deprecation warning that they should move to the new signature. +@available(SwiftStdlib 5.1, *) final class OldExecutor: SerialExecutor { func enqueue(_ job: UnownedJob) {} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'OldExecutor' to 'Executor' by implementing 'func enqueue(Job)' instead}} @@ -23,6 +21,7 @@ final class OldExecutor: SerialExecutor { /// we call into the "old one"; so the Owned version is not used in such impl. /// /// That's why we do log the deprecation warning, people should use the move-only version. +@available(SwiftStdlib 5.9, *) final class BothExecutor: SerialExecutor { func enqueue(_ job: UnownedJob) {} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'BothExecutor' to 'Executor' by implementing 'func enqueue(Job)' instead}} func enqueue(_ job: __owned ExecutorJob) {} @@ -36,6 +35,7 @@ final class BothExecutor: SerialExecutor { /// we manually detect and emit an error if neither of them is implemented. /// /// We do so because we implement them recursively, so one of them must be implemented basically. +@available(SwiftStdlib 5.9, *) final class NoneExecutor: SerialExecutor { // expected-error{{type 'NoneExecutor' does not conform to protocol 'Executor'}} func asUnownedSerialExecutor() -> UnownedSerialExecutor { @@ -44,6 +44,7 @@ final class NoneExecutor: SerialExecutor { // expected-error{{type 'NoneExecutor } /// Just implementing the new signature causes no warnings, good. +@available(SwiftStdlib 5.9, *) final class NewExecutor: SerialExecutor { func enqueue(_ job: __owned ExecutorJob) {} // no warnings