title: 'Equatable' cannot be automatically synthesized in an extension
body: <p>This works:</p>
  
  <pre><code>// Conformance to protocol correctly synthesized by compiler 
  struct MyStruct: Equatable { 
  }
  </code></pre>
  
  <p>This doesn't:</p>
  
  <pre><code>struct MyStruct { 
  }
  // Doesn't work, even though the extension is in the same file
  extension MyStruct: Equatable {
  }
  </code></pre>
  
  <p>The error is very clear:</p>
  
  <blockquote>
    <p>implementation of 'Equatable' cannot be automatically synthesized in an extension</p>
  </blockquote>
  
  <p>My concern is that according to Swift's proposal <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md#requesting-synthesis-is-opt-in" rel="nofollow noreferrer">SE-0185</a>, this should be allowed:</p>
  
  <blockquote>
    <p><strong>SE-0185: Synthesizing <code>Equatable</code> and <code>Hashable</code> conformance</strong></p>
    
    <p>Users must opt-in to automatic synthesis by declaring their type as <code>Equatable</code> or <code>Hashable</code> without implementing any of their requirements. This conformance must be part of the original type declaration <strong>or in an extension in the same file</strong> (to ensure that private and fileprivate members can be accessed from the extension).</p>
  </blockquote>
  
  <p>It says this was implemented in Swift 4.1 (<a href="https://github.com/apple/swift/pull/9619" rel="nofollow noreferrer">apple/swift#9619</a>).</p>
  
  <p>However, when trying to compile, I get the error previously shown. I'm using Ubuntu 16.04, it fails with these two versions of swift I've got:</p>
  
  <ul>
  <li><code>Swift version 4.1-dev (LLVM 260a172ffb, Clang cd84be6c42, Swift 05b1b2be7c)</code></li>
  <li><code>Swift version 4.2-dev (LLVM d30879863e, Clang 041fd44ebe, Swift b08fb12358)</code></li>
  </ul>
  
  <p>Am I missing something?</p>