Skip to content

[SE-0470] Reinstate sendable-metatype model for type checking generics #2763

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
Apr 8, 2025

Conversation

DougGregor
Copy link
Member

Based on discussions in the review thread, reinstate the sendable-metatype model for type checking generic definitions rather than the potentially-isolated-conformance model. While slightly less expressive, the sendable-metatype model is easier to reason about and teach.

It's still possible to generalize the model toward the potentially-isolated-conformance model, as is already captured in Future Directions.

Verified

This commit was signed with the committer’s verified signature.
DougGregor Doug Gregor
Based on discussions in the review thread, reinstate the
sendable-metatype model for type checking generic definitions rather
than the potentially-isolated-conformance model. While slightly less
expressive, the sendable-metatype model is easier to reason about and
teach.

It's still possible to generalize the model toward the
potentially-isolated-conformance model, as is already captured in
Future Directions.

Verified

This commit was signed with the committer’s verified signature.
DougGregor Doug Gregor
Close a potential data race with my attempt to loosen the rules. In
essence, if we're allowed to pass a metatype `T.Type` across isolation
boundaries when there are no constraints of the form `T: P`, then we
will incorrectly allow a dynamic cast `as? any T & P` to bind to an
isolated conformance (because `T` is not `SendableMetatype`).
@xwu xwu merged commit e2b1b4d into swiftlang:main Apr 8, 2025
@DougGregor DougGregor deleted the se-0470-sendable-metatypes branch April 13, 2025 23:15
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.

None yet

2 participants