-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Executors] Do not consider Loc validity in determining to emit error/warning about enqueue(_:) #67957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Executors] Do not consider Loc validity in determining to emit error/warning about enqueue(_:) #67957
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: %target-typecheck-verify-swift -disable-availability-checking | ||
// REQUIRES: concurrency | ||
|
||
// rdar://106849189 move-only types should be supported in freestanding mode | ||
// UNSUPPORTED: freestanding | ||
|
||
|
||
extension Executor { | ||
func enqueue(_ job: UnownedJob) { // expected-warning{{'Executor.enqueue(UnownedJob)' is deprecated as a protocol requirement; conform type 'NoneExecutor' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we prevent warnings about the "default implementations in the stdlib" on purpose by looking for it, rather than relying on the LoC check, we add this test to make sure we've not accidentally prevented those warnings we DO want to emit -- whenever anything other than the Concurrency module does implement these. |
||
fatalError() | ||
} | ||
} | ||
|
||
final class NoneExecutor: SerialExecutor { | ||
|
||
// the enqueue from the extension is properly picked up, | ||
// even though we do warn about deprecation on it in the extension. | ||
|
||
func asUnownedSerialExecutor() -> UnownedSerialExecutor { | ||
UnownedSerialExecutor(ordinary: self) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
// RUN: %target-typecheck-verify-swift -enable-experimental-move-only -disable-availability-checking | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ the flag is not doing anything anymore -> remove |
||
// RUN: %target-typecheck-verify-swift -disable-availability-checking | ||
// REQUIRES: concurrency | ||
|
||
// rdar://106849189 move-only types should be supported in freestanding mode | ||
// UNSUPPORTED: freestanding | ||
|
||
// FIXME: rdar://107112715 test failing on iOS simulator, investigating | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ radar was resolved resolved a while ago |
||
// 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. | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important because otherwise user code would be getting non-actionable and very confusing warnings about the standard library.