Swift 3 NSCache Generic parameter 'KeyType' could not be inferred
<p>This code worked in Swift 2.x:</p>

<pre><code>/// An internal in-memory cache
private var dataCache = NSCache.init()
</code></pre>

<p>In <strong>Swift 3</strong> it causes compilation error:</p>

<pre><code>Generic parameter 'KeyType' could not be inferred
</code></pre>

<p>Why is that so and how should I refactor this (Migration tool did not pick this up)?</p>