Skip to content

Commit 4f52380

Browse files
committed
feedback
1 parent 3fe201a commit 4f52380

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6679,7 +6679,7 @@ WARNING(executor_enqueue_deprecated_owned_job_implementation,Deprecation,
66796679
WARNING(executor_enqueue_unused_implementation, none,
66806680
"'Executor.enqueue(ExecutorJob)' will never be used, due to the presence of "
66816681
"'enqueue(UnownedJob)'",
6682-
(Type))
6682+
())
66836683

66846684
//------------------------------------------------------------------------------
66856685
// MARK: property wrapper diagnostics

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,10 +1350,13 @@ void swift::tryDiagnoseExecutorConformance(ASTContext &C,
13501350
// to be omitted in favor of moveOnlyEnqueueRequirement
13511351
bool canRemoveOldDecls;
13521352
if (!moveOnlyEnqueueRequirement) {
1353+
// The move only enqueue does not exist in this lib version, we must keep relying on the UnownedJob version
13531354
canRemoveOldDecls = false;
13541355
} else if (C.LangOpts.DisableAvailabilityChecking) {
1356+
// Assume we have all APIs available, and thus can use the ExecutorJob
13551357
canRemoveOldDecls = true;
13561358
} else {
1359+
// Check if the availability of nominal is high enough to be using the ExecutorJob version
13571360
AvailabilityContext requirementInfo
13581361
= AvailabilityInference::availableRange(moveOnlyEnqueueRequirement, C);
13591362
AvailabilityContext declInfo =
@@ -1366,7 +1369,7 @@ void swift::tryDiagnoseExecutorConformance(ASTContext &C,
13661369
if (!canRemoveOldDecls &&
13671370
unownedEnqueueWitnessDecl && unownedEnqueueWitnessDecl->getLoc().isValid() &&
13681371
moveOnlyEnqueueWitnessDecl && moveOnlyEnqueueWitnessDecl->getLoc().isValid()) {
1369-
diags.diagnose(moveOnlyEnqueueWitnessDecl->getLoc(), diag::executor_enqueue_unused_implementation, nominalTy);
1372+
diags.diagnose(moveOnlyEnqueueWitnessDecl->getLoc(), diag::executor_enqueue_unused_implementation);
13701373
}
13711374

13721375
// Old UnownedJob based impl is present, warn about it suggesting the new protocol requirement.

test/Concurrency/custom_executor_enqueue_availability.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// REQUIRES: concurrency
33
// REQUIRES: OS=macosx
44

5+
// rdar://106849189 move-only types should be supported in freestanding mode
6+
// UNSUPPORTED: freestanding
7+
58
/// Such a type may be encountered since Swift 5.5 (5.1 backdeployed) if someone implemented the
69
/// not documented, but public Executor types back then already. Allow these to be implemented
710
/// without warnings.

0 commit comments

Comments
 (0)