[MacRuby-devel] [MacRuby] #185: Redefining singleton methods on multiple objects at the same place

MacRuby ruby-noreply at macosforge.org
Mon Dec 22 21:47:12 PST 2008


#185: Redefining singleton methods on multiple objects at the same place
----------------------------------------+-----------------------------------
 Reporter:  vincent.isambart@…          |       Owner:  lsansonetti@…        
     Type:  defect                      |      Status:  new                  
 Priority:  major                       |   Milestone:                       
Component:  MacRuby                     |    Keywords:                       
----------------------------------------+-----------------------------------
 The following code causes a warning. The problem is when 2 different
 objects have a method defined on their singleton class at the same place.
 {{{
 def func(obj)
   def obj.a
     p self.description
     p self.class.ancestors
     super
   end
 end

 class A
   def a
   end
 end

 o1 = A.new
 o2 = A.new
 func(o1)
 func(o2)
 puts 'o1'
 o1.a
 puts 'o2'
 o2.a
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/185>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list