https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112014-11-12T15:23:56ZRuby Issue Tracking SystemRuby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=499152014-11-12T15:23:56Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Assignee</strong> set to <i>matz (Yukihiro Matsumoto)</i></li></ul><p>I agree.</p>
<p>Deprecate first (2.2?), remove afterwards.</p>
<p>This would also simplify things if and when we want to warn/raise on unused blocks when calling user methods.</p> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=503372014-12-08T20:44:43Zheadius (Charles Nutter)headius@headius.com
<ul></ul><p>Adding a deprecation warning would be easy if we can get buy-in from matz.</p>
<p>matz: ball's in your court, I think!</p> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=782592019-05-28T20:41:19Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Copied to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/15554">Feature #15554</a>: warn/error passing a block to a method which never use a block</i> added</li></ul> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=891112020-12-10T08:53:41Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>3.0</i></del>)</li></ul> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=897412021-01-04T03:31:20Zdazuma (Daniel Azuma)dazuma@gmail.com
<ul></ul><p>Was this change implemented in Ruby 3.0.0?</p>
<p>It looks to me like it was. (And this is causing test failures on libraries that depend on this behavior.)</p>
<p>Ruby 2.7.2:</p>
<pre><code>def foo
Proc.new
end
foo # => ArgumentError
foo { :hi } # => Proc
</code></pre>
<p>Ruby 3.0.0:</p>
<pre><code>def foo
Proc.new
end
foo # => ArgumentError
foo { :hi } # => ArgumentError
</code></pre> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=897452021-01-04T06:40:32Zdazuma (Daniel Azuma)dazuma@gmail.com
<ul></ul><p>Note that the documentation still specifies the old behavior in 3.0.0.</p>
<blockquote>
<p>Creates a new Proc object, bound to the current context. ::new may be called without a block only within a method with an attached block, in which case that block is converted to the Proc object.</p>
</blockquote>
<p><a href="https://ruby-doc.org/core-3.0.0/Proc.html#method-c-new" class="external">https://ruby-doc.org/core-3.0.0/Proc.html#method-c-new</a><br>
<a href="https://github.com/ruby/ruby/blob/95aff214687a5e12c3eb57d056665741e734c188/proc.c#L800-L813" class="external">https://github.com/ruby/ruby/blob/95aff214687a5e12c3eb57d056665741e734c188/proc.c#L800-L813</a></p> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=897482021-01-04T06:54:51Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="[DOC] Update Proc.new without a block [ci skip] [Feature #10499] [Feature #15554]" href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/8da7f4abc779c6549833d718336d75aac98494b8">git|8da7f4abc779c6549833d718336d75aac98494b8</a>.</p>
<hr>
<p>[DOC] Update Proc.new without a block [ci skip]</p>
<p>[Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Eliminate implicit magic in Proc.new and Kernel#proc (Closed)" href="https://redmine.ruby-lang.org/issues/10499">#10499</a>]<br>
[Feature <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: warn/error passing a block to a method which never use a block (Open)" href="https://redmine.ruby-lang.org/issues/15554">#15554</a>]</p> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=897492021-01-04T06:55:35Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Thank you, updated.</p> Ruby master - Feature #10499: Eliminate implicit magic in Proc.new and Kernel#prochttps://redmine.ruby-lang.org/issues/10499?journal_id=1072122024-03-14T02:56:23Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Copied to</strong> deleted (<i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/15554">Feature #15554</a>: warn/error passing a block to a method which never use a block</i>)</li></ul>