[MacRuby] #1358: Methods declared on a subclass of Module cannot be called

MacRuby ruby-noreply at macosforge.org
Wed Jul 13 21:36:38 PDT 2011


#1358: Methods declared on a subclass of Module cannot be called
------------------------------------+---------------------------------------
 Reporter:  mrada@…                 |       Owner:  lsansonetti@…        
     Type:  defect                  |      Status:  new                  
 Priority:  major                   |   Milestone:                       
Component:  MacRuby                 |    Keywords:  reduction            
------------------------------------+---------------------------------------
 I am trying to create a module that overrides #alias_method so I can delay
 the method aliasing until a later time, but when I subclass Module and add
 methods I cannot call the method. Here is a reduction:

 {{{
 class Foo < Module
   def test
     puts 'lol'
   end
 end

 foo = Foo.new


 foo.test # => NoMethodError: private method
 foo.instance_eval { test } # => ArgumentError: wrong number of arguments
 foo.module_eval { test } # => ArgumentError: wrong number of arguments
 }}}

 The same code works on CRuby in all cases, even though that seems weird.

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



More information about the macruby-tickets mailing list