Skip to content

Marker protocols and conditional conformances #36069

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

Conversation

DougGregor
Copy link
Member

Introduce two semantic tweaks for marker protocols:

  • Allow implied conditional conformances to marker protocols.
  • Ban use of marker protocols in conditional conformances to non-marker protocols

This improves source compatibility in cases where a marker
protocol is introduced after-the-fact (e.g., for `Error`),
and is safe because there's no runtime component to marker protocols.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

… protocols

These conditional conformances could not be properly evaluated at
runtime, so ban them. We still allow conditional conformances to
marker protocols.
@DougGregor DougGregor force-pushed the marker-protocols-conditional-conformances branch from d59ad61 to 618378a Compare February 21, 2021 06:04
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit 58a5010 into swiftlang:main Feb 21, 2021
@DougGregor DougGregor deleted the marker-protocols-conditional-conformances branch February 21, 2021 15:45
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.

1 participant