title: Cannot explicitly specialize a generic function when using closures
body: <p>I have a function like this:</p>
  
  <pre><code>func register&lt;T: Routable&gt;(_ action: Action, withCallback callback: @escaping (T?) -&gt; Void) {
      notificationCenter.addObserver(forName: actionMap[action], object: nil, queue: .main, using: { notification in
      let routable = T(userInfo: notification.userInfo)
          callback(routable)
      })
  }
  </code></pre>
  
  <p>Where <code>Routable</code> is defined like:</p>
  
  <pre><code>protocol Routable {
      init?(userInfo: [AnyHashable: Any]?)
  }
  </code></pre>
  
  <p>When I try to use it, I receive</p>
  
  <blockquote>
    <p>Cannot explicitly specialize a generic function</p>
  </blockquote>
  
  <p>This is the usage:</p>
  
  <pre><code>controller.register&lt;Navigate&gt;(Action.navigate) { [unowned self] navigate in
      // do something
  }
  </code></pre>
  
  <p>Any idea to make the compiler happy?</p>