mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Avoid issuing warning when user lib implements only ExecutorJob enqueue
The latter example NIODefaultSerialEventLoopExecutor when the type is more available than the enqueue implementation provided via an extrension would issue a warning that that this enqueue(ExecutorJob) would not be used which is not true. We need to filter out all "default impls" from the stdlib as we issue this warning. We also put a note on the offending declaration that one can remove now, to ease getting rid of warnings when possible Resolves rdar://115166475
This commit is contained in:
@@ -26,7 +26,7 @@ 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) {}
|
||||
func enqueue(_ job: UnownedJob) {} // expected-note{{'enqueue' declared here}}
|
||||
|
||||
@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)'}}
|
||||
|
||||
Reference in New Issue
Block a user