title: Typed array of generic classes
body: <p>Consider the following simplified protocol/class hierarchy</p>
  
  <pre><code>protocol P {
  }
  
  class A: P {
  }
  
  class B: P {
  }
  
  class C&lt;T: P&gt; {
  }
  </code></pre>
  
  <p>I want to create a typed array of instances of the class <code>C</code>. The automatic type inference does not seem to work, however. When I do</p>
  
  <pre><code>let objs = [C&lt;A&gt;(), C&lt;B&gt;()]
  let obj = objs[0]
  </code></pre>
  
  <p><code>objs</code> and <code>obj</code> are of type <code>[AnyObject]</code> and <code>AnyObject</code>, respectively. I would have expected something like</p>
  
  <pre><code>let objs:[C&lt;P&gt;] = [C&lt;A&gt;(), C&lt;B&gt;()]
  </code></pre>
  
  <p>to work but it doesn't compile with the error</p>
  
  <pre><code>Using 'P' as a concrete type conforming to protocol 'P' is not supported
  </code></pre>
  
  <p>Omitting the generic type altogether like so</p>
  
  <pre><code>let objs:[C] = [C&lt;A&gt;(), C&lt;B&gt;()]
  </code></pre>
  
  <p>produces a different error on compilation</p>
  
  <pre><code>Cannot convert value of type 'NSArray' to specified type '[C]'
  </code></pre>
  
  <p>Is there any way I could create an array of <code>C</code> instances with a type more specific than <code>[AnyObject]</code>?</p>