Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #19 (new defect)

Opened 9 months ago

Last modified 3 months ago

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

Changed 9 months ago by lsansonetti@…

  • description modified (diff)
  • milestone set to MacRuby 1.0

Changed 7 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby 0.3

Should be fixed once we switch to the objc dispatcher.

Changed 3 months ago by lsansonetti@…

  • milestone changed from MacRuby 0.3 to MacRuby 0.4

Still not fixed in trunk, punting for 0.4.

Note: See TracTickets for help on using tickets.