Skip to content

[Concurrency] add fixit to add final to non-sendable class -> Sendable #83053

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

Merged
merged 2 commits into from
Jul 15, 2025

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jul 15, 2025

The previous message was just suggesting unchecked Sendable, but instead
we should be suggesting to add final to the class. We also don't
outright suggest using unchecked Sendable -- following
#81738 precedent.

Resolves rdar://155790695

@ktoso ktoso requested a review from DougGregor July 15, 2025 00:53
@ktoso
Copy link
Contributor Author

ktoso commented Jul 15, 2025

@swift-ci please smoke test

The previous message was just suggesting unchecked Sendable, but instead
we should be suggesting to add final to the class. We also don't
outright suggest using unchecked Sendable -- following
swiftlang#81738 precedent.

Resolves rdar://155790695
@ktoso ktoso force-pushed the pick-better-class-sendable-diagnostic branch from 7a74751 to f52f445 Compare July 15, 2025 01:42
@ktoso ktoso requested a review from AnthonyLatsis as a code owner July 15, 2025 01:42
@ktoso
Copy link
Contributor Author

ktoso commented Jul 15, 2025

@swift-ci please smoke test

@@ -5954,8 +5954,7 @@ ERROR(concurrent_value_outside_source_file,none,
"%kind0; use '@unchecked Sendable' for retroactive conformance",
(const ValueDecl *))
ERROR(concurrent_value_nonfinal_class,none,
"non-final class %0 cannot conform to 'Sendable'; "
"use '@unchecked Sendable'", (DeclName))
"non-final class %0 cannot conform to the 'Sendable' protocol", (DeclName))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "to the Sendable protocol" rewording because it seems that's how we spell it everywhere else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good!

@ktoso ktoso merged commit 9cc555c into swiftlang:main Jul 15, 2025
3 checks passed
@ktoso ktoso deleted the pick-better-class-sendable-diagnostic branch July 15, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants