title: How to define an array of objects conforming to a protocol?
body: <p>Given:</p>
  
  <pre><code>protocol MyProtocol {
      typealias T
      var abc: T { get }
  }
  </code></pre>
  
  <p>And a class that implements MyProtocol:</p>
  
  <pre><code>class XYZ: MyProtocol {
      typealias T = SomeObject
      var abc: T { /* Implementation */ }
  }
  </code></pre>
  
  <p>How can I define an array of objects conforming to <code>MyProtocol</code>?</p>
  
  <pre><code>var list = [MyProtocol]()
  </code></pre>
  
  <p>Gives (together with a ton of SourceKit crashes) the following error:</p>
  
  <pre><code>Protocol 'MyProtocol' can only be used as a generic constraint because it has Self or associated type requirements
  </code></pre>
  
  <p>Even though the typealias is in fact defined in <code>MyProtocol</code>.</p>
  
  <p>Is there a way to have a list of object conforming to a protocol AND having a generic constraint?</p>