title: Swift Generics: Cannot convert value of type 'NSFetchRequest<T>' to expected argument type 'NSFetchRequest<_>'
body: <p>I'm doing some refactoring to move code to using Promises (using Hydra) instead of async callbacks. I originally had this method and it worked fine:</p>
  
  <pre><code>static func fetch&lt;D: AnyDTO, E: AnyEntity&gt;(
      _ context      : NSManagedObjectContext, 
      fetch request  : NSFetchRequest&lt;E&gt;, 
      successHandler : @escaping ([D]) -&gt; (), 
      errorHandler   : @escaping ErrorHandler)
  </code></pre>
  
  <p>So I changed this to work with promises like this:</p>
  
  <pre><code>import Hydra
  
  
  static func fetch&lt;D: AnyDTO, E: AnyEntity&gt;(
      _ context     : NSManagedObjectContext, 
      fetch request : NSFetchRequest&lt;E&gt;) -&gt; Promise&lt;[D]&gt; 
  {
      return Promise&lt;[D]&gt;(in: .background) { resolve, reject, _ in
      ...
      }
  }
  </code></pre>
  
  <p>with client code trying to call the function like this:</p>
  
  <pre><code>let request: NSFetchRequest&lt;Location&gt; = Location.fetchRequest()
  return CacheUtils.fetch(context, fetch: request)
  </code></pre>
  
  <p>But the compiler is giving me this error: </p>
  
  <blockquote>
    <p>Cannot convert value of type 'NSFetchRequest' to expected
    argument type 'NSFetchRequest&lt;_>'</p>
  </blockquote>
  
  <p>and I'm unsure why. I've checked out similar questions, and noticed the issue of using a concrete type within the function (see <a href="https://stackoverflow.com/questions/44018923/swift-generics-error-cannot-convert-value-of-type-typet-to-expected-argumen">this</a>). I think <code>Promise</code> might fit this bill, but on the other hand, the <code>Promise</code> is generic, so I'm not confident that is the problem. Is it possible to do what I'm trying to achieve in Swift?</p>