[MacRuby] #204: Private methods redefined public are still in private_methods
#204: Private methods redefined public are still in private_methods ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- All classes have a private puts method. However, if you redefine publically puts in a class, puts is still in its private methods list (but it's also in the public methods). It should only be in the public methods. {{{ class A; end p A.private_instance_methods.grep(/puts/) p A.public_instance_methods.grep(/puts/) class A def puts end end p A.private_instance_methods.grep(/puts/) p A.public_instance_methods.grep(/puts/) }}} displays: {{{ [:puts] [] [:puts] [:puts] }}} instead of: (Ruby 1.9) {{{ [:puts] [] [] [:puts] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/204> MacRuby <http://macruby.org/>
#204: Private methods redefined public are still in private_methods ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by eloy.de.enige@…): Actually, it seems that this only happens with methods from Kernel. That's where puts comes from for instance. See: {{{ #!/usr/local/bin/macruby module NonKernel private def foo; end end class A include NonKernel end p A.private_instance_methods.grep(/puts|foo/) p A.public_instance_methods.grep(/puts|foo/) class A def puts end def foo end end p A.private_instance_methods.grep(/puts|foo/) p A.public_instance_methods.grep(/puts|foo/) }}} Displays: {{{ [:foo, :puts] [] [:puts] [:puts, :foo] }}} I think it's related to changes to Kernel which also cause the problem as described in ticket #188, but I think this warrants it's own test case for known bugs. Shall I add one? -- Ticket URL: <http://www.macruby.org/trac/ticket/204#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby