[#76442] [Ruby trunk Feature#11741] Migrate Ruby to Git from Subversion — naruse@...
Issue #11741 has been updated by Yui NARUSE.
3 messages
2016/07/19
[#76515] [Ruby trunk Bug#12610] webrick: protect from httpoxy — nagachika00@...
Issue #12610 has been updated by Tomoyuki Chikanaga.
3 messages
2016/07/22
[ruby-core:76619] [Ruby trunk Feature#12638] Symbol#to_proc probable bug (seems not to support refinements)
From:
nobu@...
Date:
2016-07-30 01:19:09 UTC
List:
ruby-core #76619
Issue #12638 has been updated by Nobuyoshi Nakada.
Tracker changed from Bug to Feature
----------------------------------------
Feature #12638: Symbol#to_proc probable bug (seems not to support refinements)
https://bugs.ruby-lang.org/issues/12638#change-59838
* Author: Adriano Mitre
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
It is my understanding that
~~~
v.map { |x| x.foobar }
~~~
should always be equivalent to
~~~
v.map(&:foobar)
~~~
The following shows a case, involving refinements, where this is not the case.
~~~
module MyExtensions
refine Object do
def foobar
self
end
end
end
class MyClass
using MyExtensions
def self.ok(ary)
ary.map { |x| x.foobar }
end
def self.error(ary)
ary.map(&:foobar)
end
end
MyClass.ok([1]) #=> [1]
MyClass.error([1]) #=> NoMethodError: undefined method `foobar' for 1:Fixnum
~~~
PS: also affects ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
--
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>