title: Swiftt3: Extension to append to Array if not duplicate
body: <p>I'm trying to write an extension to Array that appends an element to the Array only if the element does not exists in the Array already. </p>
  
  <p>This is my code:</p>
  
  <pre><code>extension MutableCollection where Iterator.Element: Equatable {
      mutating func addObjectIfNew &lt;T: Equatable&gt; (_ item: T)  {
          if !self.contains(item as! Self.Iterator.Element) { 
              self.append(x as! Self.Iterator.Element) // offending line
          }
      }
  }
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>error: value of type 'Self' has no member 'append'</p>
  </blockquote>
  
  <p>What's the proper way to write such extension?</p>
  
  <p><strong>Update</strong>: I can't use a Set because I need to perform this operation on an object that needs to be indexed (i.e., Array)</p>