title: Swift generic array with type constraint
body: <p>I'm trying to write a swift method that returns a generic array. I've left out some of the details, but kept the important bit that isn't working for clarity...</p>
  
  <pre><code>protocol AProtocol {
      func doSomething()
  }
  
  func decode&lt;T: AProtocol&gt;(jsonArray: Array&lt;AnyObject&gt;?) -&gt; [T: AProtocol] {
      //...
      var resultArray = [T: AProtocol]()
      resultArray.append
      //...
  }
  </code></pre>
  
  <p>When I specify that the array contains type T: AProtocol, then the append method no longer appears</p>
  
  <blockquote>
    <p>[T: AProtocol] does not have a member named append</p>
  </blockquote>