Skip to content

Add @retroactive to conformances that need it #712

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 1 commit into from
Jan 22, 2024

Conversation

tshortli
Copy link
Contributor

SE-0364 requires that retroactive conformance be marked with @retroactive to suppress warnings about the dangers of conforming types you don't own to protocols you don't own. The RegexBuilder module declares conformances to RegexComponent (from the Regex module) on several types from the standard library, like String. Since RegexBuilder declares neither the protocol nor the conforming type, these conformances are technically retroactive even though the modules involved are all developed and distributed together and can be trusted to organize the conformances this way safely.

The compiler warnings about these conformances are quite spammy; they get emitted every time someone builds the Swift compiler, so I'd like to suppress them.

SE-0364 requires that retroactive conformance be marked with `@retroactive` to
suppress warnings about the dangers of conforming types you don't own to
protocols you don't own. The `RegexBuilder` module declares conformances to
`RegexComponent` (from the `Regex` module) on several types from the standard
library, like `String`. Since `RegexBuilder` declares neither the protocol nor
the conforming type, these conformances are technically retroactive even though
the modules involved are all developed and distributed together and can be
trusted to organize the conformances this way safely.

The compiler warnings about these conformances are quite spammy; they get
emitted every time someone builds the Swift compiler, so I'd like to suppress
them.
@tshortli tshortli requested a review from natecook1000 January 17, 2024 04:24
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli requested a review from milseman January 19, 2024 17:06
Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

lgtm

@natecook1000 natecook1000 merged commit 788942b into swiftlang:swift/main Jan 22, 2024
@tshortli tshortli deleted the retro-conformances branch January 22, 2024 18:25
natecook1000 pushed a commit that referenced this pull request Jan 22, 2024
SE-0364 requires that retroactive conformance be marked with `@retroactive` to
suppress warnings about the dangers of conforming types you don't own to
protocols you don't own. The `RegexBuilder` module declares conformances to
`RegexComponent` (from the `Regex` module) on several types from the standard
library, like `String`. Since `RegexBuilder` declares neither the protocol nor
the conforming type, these conformances are technically retroactive even though
the modules involved are all developed and distributed together and can be
trusted to organize the conformances this way safely.

The compiler warnings about these conformances are quite spammy; they get
emitted every time someone builds the Swift compiler, so I'd like to suppress
them.
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.

3 participants