[MacRuby] #563: Retrieving the singleton class of a class seems to return Class.
#563: Retrieving the singleton class of a class seems to return Class. -------------------------------------+-------------------------------------- Reporter: eloy.de.enige@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: mocha -------------------------------------+-------------------------------------- For example: {{{ % cat t.rb class A def self.singleton_class (class << self; self; end) end end p A.singleton_class % ruby19 t.rb #<Class:A> % macruby t.rb Class }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/563> MacRuby <http://macruby.org/>
#563: Retrieving the singleton class of a class seems to return Class. -------------------------------------+-------------------------------------- Reporter: eloy.de.enige@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: mocha -------------------------------------+-------------------------------------- Comment(by pthomson@…): I think the problem here is just in the #inspect method for singleton classes. The object_id's of A's singleton class and A's class are different: {{{ irb(main):008:0> A.singleton_class.object_id => 8592372416 irb(main):009:0> A.class.object_id => 8590007040 irb(main):010:0> A.class == Class => true irb(main):011:0> A.singleton_class == Class => false }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/563#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby