What mean "automatically synthesized in an extension"?

Hello. In Swift 4.1 appear new type of Warnings.
For example I want to implement conformance to Equatable in extension

struct One {}
extension One: Equatable {
//    static func == (lhs: One, rhs: One) -> Bool {
//        return true
//    }
}

And we have warning:
Implementation of 'Equatable' cannot be automatically synthesized in an extension

What is the new Automatically Synthesized. Where I can read about it?

Indeed, there is a new feature for synthesizing == and hashValue in Swift 4.1. Check out https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md. This gives a good overview of the feature as well as the specific restriction you observed.

4 Likes