Projects

Ticket #717 (closed defect: fixed)

Opened 21 months ago

Last modified 4 months ago

Including a module into class Object makes it impossible to override methods, from modules, in class Class or class Module

Reported by: eloy.de.enige@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.11
Component: MacRuby Keywords: mocha #reduction
Cc: martin@…, ernest.prabhakar@…

Description

% cat t.rb
module ObjectMethods
  def foo
    ObjectMethods
  end
end

module ModuleMethods
  def foo
    ModuleMethods
  end
end

module ClassMethods
  def foo
    ClassMethods
  end
end

class Object
  include ObjectMethods
end

class Module
  include ModuleMethods
end

class Class
  include ClassMethods
end

p Object.new.foo
p Module.new.foo
p Class.new.foo

% ruby19 t.rb
ObjectMethods
ModuleMethods
ClassMethods

% macruby t.rb
ObjectMethods
ObjectMethods
ObjectMethods

Change History

Changed 14 months ago by mattaimonetti@…

  • keywords #reduction added

still happening

Changed 8 months ago by martin@…

Still happening as of  https://github.com/MacRuby/MacRuby/commit/8b4d3bd0129c385668b1933ec646a14591661489, but with different output:

$ ruby19 t.rb 
ObjectMethods
ModuleMethods
ClassMethods

$ macruby t.rb 
ObjectMethods
ClassMethods
ClassMethods

Changed 8 months ago by martin@…

  • cc martin@… added

Cc Me!

Changed 8 months ago by eloy.de.enige@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.11

I’m inclined to say that since the only problem now is that including a module into Class also includes it in Module it's now a duplicate of #718. Closing for now.

Changed 4 months ago by ernest.prabhakar@…

  • cc ernest.prabhakar@… added

Cc Me!

Note: See TracTickets for help on using tickets.