Issue #15078 has been updated by marcandre (Marc-Andre Lafortune).


mame (Yusuke Endoh) wrote:
> Yes.  Your proposal looks the best semantics so far for Ruby 2.X, at least to me.  Note that akr-san is also reasonable: from 2.0, a method call has always passed the same value array and a block, without depending upon the definition of the method, he said.  Your proposal breaks the principle.  (Honestly, I'm unsure if the principle is still valid or not.  Too complex...)

Indeed, my proposal breaks that (on purpose) :-)

> > Please consider my "vote" as in favor of half your proposal, and strong opposition to the other half :-)
> 
> Did you see [my problem of the note 29 in #14183](https://bugs.ruby-lang.org/issues/14183#note-29)?  Unfortunately, prohibiting the half does not solve the problem at all.

Yes, I saw it. It's definitely true my proposal wouldn't fix it (until Ruby 42.0.0 ;-) ). I'm not very concerned about it though. Care would still be required when changing a method from positional arguments only to keyword arguments, if the last positional argument could be a hash. That's a rare case, and you can write your code to avoid the issue.

I feel the incompatibility with `key: value` no longer being converted to positional if need be is simply too big for the gain.

----------------------------------------
Bug #15078: Hash splat of empty hash should not create a positional argument.
https://bugs.ruby-lang.org/issues/15078#change-74048

* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
* ruby -v: ruby 2.6.0dev (2018-08-27 trunk 64545) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Looks like #10856 is not completely fixed, but I can't reopen it

```
def foo(*args); args; end
foo(**{}) # => []
foo(**Hash.new) # => [{}], should be []
```



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