title: Ambiguous use of 'filter' after migration to Swift 4.2
body: <p>am struggling to solve this small bug on the following extension on Dictionary. I realise there is a similar answer stating that declaring the variable type before returning it fixes it:
  <a href="https://stackoverflow.com/questions/46339586/ambiguous-use-of-filter-when-converting-project-to-swift-4">Ambiguous use of &#39;filter&#39; when converting project to Swift 4</a></p>
  
  <p>However I'm not sure of the 'filter' type? Any help would be great. Cheers</p>
  
  <pre><code>func pick(_ keys: [Key]) -&gt; Dictionary {
      return filter { (key: Key, _) -&gt; Bool in
          keys.contains(key)
      }
  }
  </code></pre>