Skip to content

[Concurrency] Fix SendableMetatype conformance failures to behave l… #82004

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 4, 2025

…ike Sendable ones

No warnings with minimal checking, warnings with strict-concurrency=complete and if declaration is @preconcurrency until next major swift version.

Resolves: rdar://151911135
Resolves: #81739

@xedin xedin requested a review from DougGregor June 4, 2025 23:25
/// Sendable.
static void addSendableFixIt(const GenericTypeParamDecl *genericArgument,
InFlightDiagnostic &diag) {
addProtocolFixIt(genericArgument, diag, "Sendable");
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit, is it worth doing getProtocolName(KnownProtocolKind::Sendable) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, good idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Fantastic, thank you!

@@ -5943,6 +5943,8 @@ ERROR(concurrent_value_inherit,none,
(bool, DeclName))
ERROR(non_sendable_type,none,
"type %0 does not conform to the 'Sendable' protocol", (Type))
ERROR(non_sendable_metatype_type,none,
Copy link
Member

Choose a reason for hiding this comment

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

Can you put this diagnostic in the new SendableMetatypes group?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xedin xedin force-pushed the rdar-151911135 branch from fe6d9bc to d3f06f4 Compare June 5, 2025 00:15
@xedin
Copy link
Contributor Author

xedin commented Jun 5, 2025

@swift-ci please test

…ike `Sendable` ones

No warnings with minimal checking, warnings with `strict-concurrency=complete` and
if declaration is `@preconcurrency` until next major swift version.

Resolves: rdar://151911135
Resolves: swiftlang#81739
@xedin xedin force-pushed the rdar-151911135 branch from d3f06f4 to e326cd0 Compare June 5, 2025 01:09
@xedin
Copy link
Contributor Author

xedin commented Jun 5, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 5, 2025

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 5, 2025

@swift-ci please clean test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Jun 6, 2025

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 6, 2025

@swift-ci please test Linux platform

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.

@preconcurrnecy doesn't downgrade SendableMetatype error
3 participants