https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2022-03-13T16:57:42Z
Ruby Issue Tracking System
Ruby master - Bug #18629: block args array splatting assigns to higher scope _ var
https://bugs.ruby-lang.org/issues/18629?journal_id=96825
2022-03-13T16:57:42Z
jeremyevans0 (Jeremy Evans)
merch-redmine@jeremyevans.net
<ul></ul><p>I'm guessing this isn't a bug, because variables prefixed by <code>_</code> (including <code>_</code> itself) are supposed to be used in cases where you are ignoring the values. There are other cases where <code>_</code> prefixed variables are special:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">a</span><span class="p">(</span><span class="n">b</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span> <span class="k">end</span> <span class="c1"># SyntaxError</span>
<span class="k">def</span> <span class="nf">a</span><span class="p">(</span><span class="n">_b</span><span class="p">,</span> <span class="n">_b</span><span class="p">)</span> <span class="k">end</span> <span class="c1"># no error</span>
</code></pre>
Ruby master - Bug #18629: block args array splatting assigns to higher scope _ var
https://bugs.ruby-lang.org/issues/18629?journal_id=97374
2022-04-21T12:04:23Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN</i> to <i>2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED</i></li></ul>
Ruby master - Bug #18629: block args array splatting assigns to higher scope _ var
https://bugs.ruby-lang.org/issues/18629?journal_id=97389
2022-04-22T02:05:16Z
mame (Yusuke Endoh)
mame@ruby-lang.org
<ul></ul><p>This ticket was discussed at the dev meeting, and <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/13">@matz (Yukihiro Matsumoto)</a> said it should be fixed. <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/4">@nobu (Nobuyoshi Nakada)</a> has already committed a fix 3ddf6ad4d2f6dae4caa00b8c407768c7062099a0</p>
Ruby master - Bug #18629: block args array splatting assigns to higher scope _ var
https://bugs.ruby-lang.org/issues/18629?journal_id=97390
2022-04-22T02:05:23Z
mame (Yusuke Endoh)
mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>
Ruby master - Bug #18629: block args array splatting assigns to higher scope _ var
https://bugs.ruby-lang.org/issues/18629?journal_id=101997
2023-02-23T06:11:45Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED</i> to <i>2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE</i></li></ul><p>ruby_3_1 536f5ba0d48c033e63398d1751aebd0a11bcc6ff merged revision(s) 3ddf6ad4d2f6dae4caa00b8c407768c7062099a0.</p>