singleton_class.define_method creates private methods
-----------------------------------------------------

                 Key: JRUBY-5376
                 URL: http://jira.codehaus.org/browse/JRUBY-5376
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.6RC1
            Reporter: John Firebaugh
            Assignee: Thomas E Enebo


{code}
module Kernel
  def singleton_class
    class << self
      self
    end
  end
end

o = Object.new
o.singleton_class.send(:define_method, :foo) do
  puts "foo"
end
o.foo
{code}

Output on 1.5.6, 1.8.7, and 1.9.2 is "foo". Output on 1.6.0rc1 is "private 
method `foo' called for #<Object:0xd61aef> (NoMethodError)".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to