title: Swift Generics: Cannot convert value of type to expected argument type
body: <p>Here is my code:</p>
  
  <pre><code>protocol SomeProtocol {
  }
  
  class A: SomeProtocol {
  }
  
  func f1&lt;T: SomeProtocol&gt;(ofType: T.Type, listener: (T?) -&gt; Void) {
  }
  
  func f2&lt;T: SomeProtocol&gt;(ofType: T.Type, listener: ([T]?) -&gt; Void) {
  }
  
  func g() {
      let l1: (SomeProtocol?) -&gt; Void = ...
      let l2: ([SomeProtocol]?) -&gt; Void = ...
      f1(ofType: A.self, listener: l1) // NO ERROR
      f2(ofType: A.self, listener: l2) // COMPILE ERROR: Cannot convert value of type '([SomeProtocol]?) -&gt; Void' to expected argument type '([_]?) -&gt; Void'
  }
  </code></pre>
  
  <p>What is the problem with the second closure having an argument of an <strong>array</strong> of generic type objects?</p>