Project

General

Profile

Bug #4889

methods defined using define_singleton_method in Array.each loop report wrong __method__

Added by yaauie (Ryan Biesemeyer) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
Backport:
[ruby-core:37157]

Description

--CODE--
class A
[:foo,:bar].each do |a|
define_singleton_method(a) do
puts method
end
end
nil
end
A.foo
A.bar
exit
--EXPECTED-RESULT--
foo
bar
--ACTUAL-RESULT--
bar
bar


Related issues

Is duplicate of Ruby master - Bug #4606: Regression of __method__ on 1.9ClosedActions

History

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Category set to core
  • Status changed from Open to Closed
  • Assignee set to nagachika (Tomoyuki Chikanaga)
  • Target version set to 1.9.2

Hi, Ryan

Thank you for your report.

It is similar to #4606 and already fixed by r31436 in trunk and back ported to
ruby_1_9_2 branch by r31830.
Please wait coming release, or you can try with 1.9.2-head :)

Regards,

Also available in: Atom PDF