[#102393] [Ruby master Feature#17608] Compact and sum in one step — sawadatsuyoshi@...

Issue #17608 has been reported by sawa (Tsuyoshi Sawada).

13 messages 2021/02/04

[#102438] [Ruby master Bug#17619] if false foo=42; end creates a foo local variable set to nil — pkmuldoon@...

Issue #17619 has been reported by pkmuldoon (Phil Muldoon).

10 messages 2021/02/10

[#102631] [Ruby master Feature#17660] Expose information about which basic methods have been redefined — tenderlove@...

Issue #17660 has been reported by tenderlovemaking (Aaron Patterson).

9 messages 2021/02/27

[#102639] [Ruby master Misc#17662] The herdoc pattern used in tests does not syntax highlight correctly in many editors — eregontp@...

Issue #17662 has been reported by Eregon (Benoit Daloze).

13 messages 2021/02/27

[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...

Issue #17664 has been reported by ciconia (Sharon Rosner).

23 messages 2021/02/28

[ruby-core:102659] [Ruby master Bug#16632] Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6

From: usa@...
Date: 2021-02-28 14:32:46 UTC
List: ruby-core #102659
Issue #16632 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONTNEED to 2.5: DONTNEED, 2.6: DONE, 2.7: DONTNEED

patched to ruby_2_6 at r67899.

----------------------------------------
Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6
https://bugs.ruby-lang.org/issues/16632#change-90653

* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-openbsd]
* Backport: 2.5: DONTNEED, 2.6: DONE, 2.7: DONTNEED
----------------------------------------
Ruby 2.6 will issue a verbose mode warning if treating a keyword splat as a positional argument if the method does not accept rest arguments or keyword arguments.  This is different from Ruby 2.5, 2.7, and the master branch.

```
$ ruby25 -ve 'def a(b); b end; hash = {bar: 1}; p a(**hash)'
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-openbsd]
{:bar=>1}

$ ruby26 -ve 'def a(b); b end; hash = {bar: 1}; p a(**hash)'
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-openbsd]
-e:1: warning: in `a': the last argument was passed as a single Hash
-e:1: warning: although a splat keyword arguments here
{:bar=>1}

$ ruby27 -ve 'def a(b); b end; hash = {bar: 1}; p a(**hash)'
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-openbsd]
{:bar=>1}
```

My guess for the reason for the Ruby 2.6 behavior is it was done before we agreed on the semantics of keyword argument separation.  If we were going to drop keyword argument to positional argument conversion for methods that did not accept keyword arguments, it is a reasonable warning.  However, since we convert keyword arguments to positional arguments for methods that do not accept keywords, the 2.6 verbose mode warning doesn't make sense and I think should be removed.  See attached diff for the removal of the warning and updating of related test.

---Files--------------------------------
remove-verbose-warning-keyword-splat-to-positional.patch (2.1 KB)


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

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

In This Thread

Prev Next