You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// We warn on the ExecutorJob witness if the type has a broader
18
+
/// availability, since in this case the UnownedJob version needs to exist.
19
+
@available(SwiftStdlib 5.1,*)
20
+
finalclassBothExecutorOldStdlib:SerialExecutor{
21
+
func enqueue(_ job:UnownedJob){}
22
+
23
+
@available(SwiftStdlib 5.9,*)
24
+
func enqueue(_ job:__owned ExecutorJob){} // expected-warning{{'Executor.enqueue(ExecutorJob)' will never be used, due to the presence of 'enqueue(UnownedJob)'}}
/// Meanwhile, we warn on the UnownedJob overload if the availability is new enough
32
+
/// that it can be dropped.
33
+
@available(SwiftStdlib 5.9,*)
34
+
finalclassBothExecutorNewStdlib:SerialExecutor{
35
+
func enqueue(_ job:UnownedJob){} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'BothExecutorNewStdlib' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
func enqueue(_ job:UnownedJob){} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'TripleExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
47
+
48
+
// expected-warning@+2{{'Job' is deprecated: renamed to 'ExecutorJob'}}
49
+
// expected-note@+1{{use 'ExecutorJob' instead}}
50
+
func enqueue(_ job:__owned Job){} // expected-warning{{'Executor.enqueue(Job)' is deprecated as a protocol requirement; conform type 'TripleExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
// rdar://106849189 move-only types should be supported in freestanding mode
@@ -7,8 +7,10 @@
7
7
// FIXME: rdar://107112715 test failing on iOS simulator, investigating
8
8
// UNSUPPORTED: OS=ios
9
9
10
-
// If the availability is recent enough, log a deprecation warning to move to the new signature.
11
-
@available(SwiftStdlib 5.9,*)
10
+
// Such type may be encountered since Swift 5.5 (5.1 backdeployed) if someone implemented the
11
+
// not documented, but public Executor types back then already.
12
+
//
13
+
// We keep support for them, but also log a deprecation warning that they should move to the new signature.
12
14
finalclassOldExecutor:SerialExecutor{
13
15
func enqueue(_ job:UnownedJob){} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'OldExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
14
16
@@ -17,23 +19,10 @@ final class OldExecutor: SerialExecutor {
17
19
}
18
20
}
19
21
20
-
/// Such a type may be encountered since Swift 5.5 (5.1 backdeployed) if someone implemented the
21
-
/// not documented, but public Executor types back then already. Allow these to be implemented
/// Implementing both enqueue methods is legal, but somewhat useless --
33
23
/// we call into the "old one"; so the Owned version is not used in such impl.
34
24
///
35
25
/// That's why we do log the deprecation warning, people should use the move-only version.
36
-
@available(SwiftStdlib 5.9,*)
37
26
finalclassBothExecutor:SerialExecutor{
38
27
func enqueue(_ job:UnownedJob){} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'BothExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
39
28
@@ -44,22 +33,7 @@ final class BothExecutor: SerialExecutor {
44
33
}
45
34
}
46
35
47
-
/// Meanwhile, we warn on the ExecutorJob witness if the type has a broader
48
-
/// availability, since in this case the UnownedJob version needs to exist.
49
-
@available(SwiftStdlib 5.1,*)
50
-
finalclassBothExecutorOld:SerialExecutor{
51
-
func enqueue(_ job:UnownedJob){}
52
-
53
-
@available(SwiftStdlib 5.9,*)
54
-
func enqueue(_ job:__owned ExecutorJob){} // expected-warning{{'Executor.enqueue(ExecutorJob)' will never be used, due to the presence of 'enqueue(UnownedJob)'}}
/// For now we must keep all 3 implementation kinds and warn about deprecated ones
62
-
@available(SwiftStdlib 5.9,*)
63
37
finalclassTripleExecutor:SerialExecutor{
64
38
func enqueue(_ job:UnownedJob){} // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'TripleExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}}
65
39
@@ -78,7 +52,6 @@ final class TripleExecutor: SerialExecutor {
78
52
/// we manually detect and emit an error if neither of them is implemented.
79
53
///
80
54
/// We do so because we implement them recursively, so one of them must be implemented basically.
81
-
@available(SwiftStdlib 5.9,*)
82
55
finalclassNoneExecutor:SerialExecutor{ // expected-error{{type 'NoneExecutor' does not conform to protocol 'Executor'}}
0 commit comments