Issue #14579 has been updated by Eregon (Benoit Daloze).


Should this also work for non-Symbols keys like:

~~~ruby
x = 1
y = 2
h = { "x" => , "y" => }
~~~

----------------------------------------
Feature #14579: Hash value omission
https://bugs.ruby-lang.org/issues/14579#change-70911

* Author: shugo (Shugo Maeda)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
How about to allow value omission in Hash literals:

```ruby
x = 1
y = 2
h = {x:, y:}
p h #=> {:x=>1, :y=>2}
```

And in keyword arguments:

```ruby
def login(username: ENV["USER"], password:)
  p(username:, password:)
end

login(password: "xxx") #=> {:username=>"shugo", :password=>"xxx"}
```


---Files--------------------------------
hash_value_omission.diff (619 Bytes)


-- 
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>