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 swift-evolution/0185-synthesize-equatable-hashable.md at master · apple/swift-evolution · GitHub. This gives a good overview of the feature as well as the specific restriction you observed.

4 Likes