title: Swift Dictionary access value using key within extension
body: <p>It turns out that within a Dictionary extension, the subscript is quite useless since it says <code>Ambiguous reference to member 'subscript'</code>. It seems I'll either have to do what Swift does in its <code>subscript(Key)</code> or call a function. Any ideas?</p>
  
  <p>For example,</p>
  
  <pre><code>public extension Dictionary {
      public func bool(_ key: String) -&gt; Bool? {
          return self[key] as? Bool
      }
  }
  </code></pre>
  
  <p>won't work, since the subscript is said to be ambiguous.</p>
  
  <p><strong>ADDED</strong> My misunderstanding came from the fact that I assumed that <code>Key</code> is an <code>AssociatedType</code> instead of a generic parameter. </p>