Ticket #19 (new defect)
Problems with method_missing
| Reported by: | vincent.isambart@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | MacRuby 0.4 |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description (last modified by lsansonetti@…) (diff)
~/tmp% cat e.rb
module Kernel
def method_missing(method_name, *args)
puts "method #{method_name} missing"
super
end
end
Object.new.unknown_method
~/tmp% ruby e.rb
method unknown_method missing
e.rb:4:in `method_missing': super: no superclass method `unknown_method' (NoMethodError)
from e.rb:8
~/tmp% ruby-1.9 e.rb
method unknown_method missing
e.rb:4:in `method_missing': undefined method `unknown_method' for #<Object:0x0a25d0> (NoMethodError)
from e.rb:8:in `<main>'
~/tmp% macruby e.rb
e.rb:8:in `<main>': undefined method `unknown_method' for #<Object:0x10af150> (NoMethodError)
You can see that in MacRuby the redefined method_missing function is not called.
And if you replace "module Kernel" by "class NSObject", MacRuby crashes...
Change History
Note: See
TracTickets for help on using
tickets.

