Issue #12352 has been updated by Shyouhei Urabe.

Tracker changed from Bug to Feature
Project changed from Ruby trunk to CommonRuby
Status changed from Open to Assigned
Assignee set to Yukihiro Matsumoto

Matz, do you want numeric keys for new hash syntax?

----------------------------------------
Feature #12352: New hash syntax broken for numeric keys
https://bugs.ruby-lang.org/issues/12352#change-58504

* Author: Adriano Mitre
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
[[Matz himself showed in RubyConf 2015 the following example]](https://www.youtube.com/watch?v=LE0g2TUsJ4U&t=13m04s):

~~~
h = { 1: 2, 2: 4, 3: 6 }
~~~

Which gives

~~~
SyntaxError: unexpected ':', expecting =>
h = { 1: 2, 2: 4, 3: 6 }
        ^

~~~

but which should give identical results to

~~~
>> h = { 1 => 2, 2 => 4, 3 => 6 }
=> {1=>2, 2=>4, 3=>6}
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>