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:
Konrad `ktoso` Malawski
2023-09-19 17:46:18 +09:00
parent 469a614eef
commit 6714f4b301
3 changed files with 72 additions and 2 deletions

View File

@@ -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)'}}