[#97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded — shugo@...

Issue #16608 has been reported by shugo (Shugo Maeda).

10 messages 2020/02/05

[#97084] [Ruby master Feature#16614] New method cache mechanism for Guild — ko1@...

Issue #16614 has been reported by ko1 (Koichi Sasada).

18 messages 2020/02/07

[#97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 — cfis@...

Issue #16651 has been reported by cfis (Charlie Savage).

17 messages 2020/02/24

[#97289] [Ruby master Bug#16658] `method__cache__clear` DTrace hook was dropped without replacement — v.ondruch@...

Issue #16658 has been reported by vo.x (Vit Ondruch).

9 messages 2020/02/27

[#97307] [Ruby master Feature#16663] Add block or filtered forms of Kernel#caller to allow early bail-out — headius@...

Issue #16663 has been reported by headius (Charles Nutter).

29 messages 2020/02/28

[#97310] [Ruby master Feature#16665] Add an Array#except_index method — alexandr1golubenko@...

Issue #16665 has been reported by alex_golubenko (Alex Golubenko).

12 messages 2020/02/29

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

From: daniel@...42.com
Date: 2020-02-19 19:31:30 UTC
List: ruby-core #97204
Issue #16632 has been updated by Dan0042 (Daniel DeLorme).


This is really interesting. It means that mixing double-splat with positional-only methods was _already_ discouraged.

It feels kinda weird to be more strict about keyword/positional separation in general, but to become more more lenient for this case. Another possibility would be to re-add the warning in 2.7 and trunk. The semantics of keyword-to-positional conversion were basically reverse engineered from the 2.6 behavior, so we could say the correct behavior is "however it worked in 2.6" and this part was simply overlooked.

Also I find this gives an interesting alternative view on keyword arguments: the braceless hash syntax can be used either for a positional hash or keywords, but a double splat is specifically for keywords and shouldn't be used with a positional-only method.

I don't really have a strong opinion either way.


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

* 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: REQUIRED, 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:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next