https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112019-12-29T18:53:43ZRuby Issue Tracking SystemRuby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=835452019-12-29T18:53:43Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>Previously, the args rest array was modified, but that was changed in <a class="changeset" title="Don't modify rest array when using ruby2_keywords Previously, the rest array was modified, but i..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/299a13612e54accd9d3661bafde8f67142a78d54">299a13612e54accd9d3661bafde8f67142a78d54</a> due to the issues it caused. Duping the array before modifying it should fix those issues, at the cost of an extra array allocation.</p>
<p>I don't have strong feelings about this change. I'm not against it, so if you feel it is helpful, please commit it.</p> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=846452020-03-14T11:43:22ZEregon (Benoit Daloze)
<ul></ul><p>What about this ticket?<br>
Such code will simply break in Ruby 3 if we don't warn so I don't think there is much of a choice here.</p>
<p>It should be in 2.7.1 too as it's a fix of a missing warning necessary to migrate to Ruby 3.</p> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=846702020-03-16T04:49:46Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>For the sake of consistency and completeness, this is required, but this makes warn-hunting (especially for Rails core contributors) more difficult.</p>
<p>So I vote for keeping this behavior.</p>
<p>Matz.</p> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=847022020-03-19T01:13:26ZEregon (Benoit Daloze)
<ul></ul><p>This means adding <code>ruby2_keywords</code> is not only cumbersome and difficult, but it's also not sufficient as a reminder of which methods to update in Ruby 3+.</p>
<p>This is an implementation detail leak, and I think it makes no sense for other implementations to follow it.</p>
<p>Not fixing it in MRI forces other implementations to have the same implementation bug, or produce more warnings which is very unfortunate.<br>
Please reconsider.</p> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=847032020-03-19T01:17:43ZEregon (Benoit Daloze)
<ul></ul><p>matz (Yukihiro Matsumoto) wrote in <a href="#note-3">#note-3</a>:</p>
<blockquote>
<p>this makes warn-hunting (especially for Rails core contributors) more difficult.</p>
</blockquote>
<p>Can you explain that?<br>
AFAIK this will make code use <code>ruby2_keywords</code> in more places, but those places will need to change to use <code>*args, **kwargs</code>-delegation in Ruby 3+.<br>
So it's counterproduce to not have the warnings here, because the methods missing <code>ruby2_keywords</code> would simply break in Ruby 3+.</p> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=848852020-04-02T19:15:01ZEregon (Benoit Daloze)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/16463">Feature #16463</a>: Fixing *args-delegation in Ruby 2.7: ruby2_keywords semantics by default in 2.7.1</i> added</li></ul> Ruby master - Bug #16466: `*args -> *args` delegation should be warned when the last hash has a `ruby2_keywords` flaghttps://bugs.ruby-lang.org/issues/16466?journal_id=967842022-03-11T18:01:52ZEregon (Benoit Daloze)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/18625">Bug #18625</a>: ruby2_keywords does not unmark the hash if the receiving method has a *rest parameter</i> added</li></ul>