Skip to content

[SE-0302] Clarify inference for non-public structs and enums and frozen public structs and enums #1303

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
Mar 30, 2021

Conversation

DougGregor
Copy link
Member

No description provided.

@@ -264,7 +264,7 @@ extension MySneakyNSPerson: @unchecked Sendable { }
#### Implicit struct/enum conformance to `Sendable`

Many structs and enums satisfy the requirements of `Sendable`, and having to explicitly write out "`: Sendable`" for every such type can feel like boilerplate.
For non-public, non-frozen structs and enums, the `Sendable` conformance is implicitly provided when conformance checking (described in the previous section) succeeds:
For non-public structs and enums that are also not `@usableFromInline`, and for frozen public structs and enums, the `Sendable` conformance is implicitly provided when conformance checking (described in the previous section) succeeds:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason the frozen rule doesn't apply to @usableFromInline structs and enums?

@lattner
Copy link
Collaborator

lattner commented Mar 18, 2021

lgtm doug

@DougGregor DougGregor merged commit 2794ea5 into swiftlang:main Mar 30, 2021
@DougGregor DougGregor deleted the se-0302-frozen-cleanup branch March 30, 2021 17:14
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.

4 participants