https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112020-02-19T19:31:30ZRuby Issue Tracking SystemRuby master - Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6https://bugs.ruby-lang.org/issues/16632?journal_id=843122020-02-19T19:31:30ZDan0042 (Daniel DeLorme)
<ul></ul><p>This is really interesting. It means that mixing double-splat with positional-only methods was <em>already</em> discouraged.</p>
<p>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.</p>
<p>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.</p>
<p>I don't really have a strong opinion either way.</p> Ruby master - Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6https://bugs.ruby-lang.org/issues/16632?journal_id=843382020-02-21T09:39:44ZEregon (Benoit Daloze)
<ul></ul><p>As mentioned in <a href="https://bugs.ruby-lang.org/issues/16511#note-17" class="external">https://bugs.ruby-lang.org/issues/16511#note-17</a><br>
it seems very unlikely this triggers in practice, because indeed who would bother with an extra <code>**</code> when the method doesn't take keyword arguments?<br>
Maybe for the case the user thinks the method takes keyword arguments but it doesn't (yet, maybe the next gem version does)?</p>
<p>Anyway, agreed with Jeremy, no point to warn about something which no longer warns in more recent versions.<br>
Warning <code>**</code> but not <code>foo: 1</code> as a special case seems to just make things more complicated.</p> Ruby master - Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6https://bugs.ruby-lang.org/issues/16632?journal_id=843802020-02-26T01:11:27Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>Looking through the repository history, the patch attached to this issue is mostly implemented by <a class="changeset" title="Remove a verbose warning that is no longer needed This warns about a case that we will continue ..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/6424d316b993ecceb6f583ae476096274e304788">6424d316b993ecceb6f583ae476096274e304788</a>, so that commit could be backported instead, though I'm not sure it applies without conflicts.</p> Ruby master - Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6https://bugs.ruby-lang.org/issues/16632?journal_id=860982020-06-11T14:05:12Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/16950">Bug #16950</a>: Stop nonsense keyword argument warnings in 2.6</i> added</li></ul> Ruby master - Bug #16632: Remove verbose warning on treating keyword splat as positional argument in Ruby 2.6https://bugs.ruby-lang.org/issues/16632?journal_id=906532021-02-28T14:32:45Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONTNEED</i> to <i>2.5: DONTNEED, 2.6: DONE, 2.7: DONTNEED</i></li></ul><p>patched to ruby_2_6 at r67899.</p>