title: Why does double splat only work with symbol keys?
body: <p>The double splat operator <code>**</code> only seems to work with hashes whose keys are symbols. It will not work when a key is a string, for example. This is true for both ways; for construction:</p>
  
  <pre><code>def foo **; end
  foo(:a =&gt; 3) #=&gt; nil
  foo("a" =&gt; 3) #=&gt; ArgumentError: wrong number of arguments (1 for 0)
  </code></pre>
  
  <p>and destruction:</p>
  
  <pre><code>def bar *; end
  bar(**{:a =&gt; 3}) #=&gt; nil
  bar(**{"a" =&gt; 3}) #=&gt; TypeError: wrong argument type String (expected Symbol)
  </code></pre>
  
  <p>Why is it limited to symbol keys?</p>
  
  <p>It may be related to the fact that named keyword notation <code>a: 3</code> coincides with the syntax sugar for hash with symbol keys, but as seen above, the double splat works with the ordinary hash notation <code>:a =&gt; 3</code>, so I am not sure about this.</p>