Type 'NSDictionary!' has no subscript members Swift - 3.0 conversion issue
<p>I am getting this compiler error below after auto conversion from Swift 2 to Swift 3,</p>

<blockquote>
  <p>Type 'NSDictionary!' has no subscript members</p>
</blockquote>

<p>I have seen similar question in <a href="https://stackoverflow.com/questions/39641676/type-any-has-no-subscript-members-swift-3-0">this post</a>, but still the solution is not supposed to work for NSDictionary.</p>

<p>Please let me know how to fix it.</p>

<p>Code:</p>

<pre><code>fileprivate var allData:NSDictionary!;
.
.
.
open func getData(_ key:String) -&gt; AnyObject?
{
    return allData[key]; // error in this line
}
</code></pre>