-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Changelog] Add a note about conformance synthesis in same-file extensions. #16666
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
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CHANGELOG.md
Outdated
Code that wants to be as precise as possible should generally not | ||
conditionally conform to `Codable` directly, but rather its two constituent | ||
protocols, or else one can only (for instance) decode a `Generic<Param>` if | ||
`Param` is `Encodable` in additional to the `Decodable`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional?
CHANGELOG.md
Outdated
@@ -57,6 +57,40 @@ Swift 5.0 | |||
Swift 4.2 | |||
--------- | |||
|
|||
* [SE-0185][] | |||
|
|||
Protocol conformances can now be synthesized in extensions in the same file as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can now be" -> "are now"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "can" is right here: the synthesis doesn't always happen.
CHANGELOG.md
Outdated
struct Generic<Param> { | ||
var property: Param | ||
} | ||
extension Generic: Equatable where Param: Equatable {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this last part is the auto-synthesized part, it's not clear. You could put it into a comment with something like:
// Automatically synthesized:
// extension Generic...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added:
// Automatically synthesized inside the extension:
// static func ==(lhs: Generic, rhs: Generic) -> Bool {
// return lhs.property == rhs.property
// }
CHANGELOG.md
Outdated
|
||
Code that wants to be as precise as possible should generally not | ||
conditionally conform to `Codable` directly, but rather its two constituent | ||
protocols, or else one can only (for instance) decode a `Generic<Param>` if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"two constituent protocols" -> "two constituent protocols Foo and Bar"
where Foo and Bar are the constituent protocols...
31c8a09
to
d4a9d51
Compare
@swift-ci please smoke test |
No description provided.