title: Protocol doesn't conform to itself?
body: <p>Why doesn't this Swift code compile?</p>
  
  <pre><code>protocol P { }
  struct S: P { }
  
  let arr:[P] = [ S() ]
  
  extension Array where Element : P {
      func test&lt;T&gt;() -&gt; [T] {
          return []
      }
  }
  
  let result : [S] = arr.test()
  </code></pre>
  
  <p>The compiler says: "Type <code>P</code> does not conform to protocol <code>P</code>" (or, in later versions of Swift, "Using 'P' as a concrete type conforming to protocol 'P' is not supported.").</p>
  
  <p>Why not? This feels like a hole in the language, somehow. I realize that the problem stems from declaring the array <code>arr</code> as an array <em>of a protocol type</em>, but is that an unreasonable thing to do? I thought protocols were there exactly to help supply structs with something like a type hierarchy?</p>