[MacRuby] #371: Module methods included in the class Module are not visible to other classes.
#371: Module methods included in the class Module are not visible to other classes. ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ {{{ module A def b puts 'b' end end class Module include A end class C b() end }}} Running the above on Ruby 1.9 prints out 'b'. Running it on MacRuby 0.5 generates an "undefined method `b' for C:Class (NoMethodError)" -- Ticket URL: <http://www.macruby.org/trac/ticket/371> MacRuby <http://macruby.org/>
#371: Module methods included in the class Module are not visible to other classes. ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by keith.gautreaux@…): It seems that MacRuby treats modules differently than Ruby 1.9. You shouldn't be able to instantiate a named module using the new method, i.e. A = Module.new do def meth1 "hello" end end a = A.new (shouldn't work) => NoMethodError: undefined method `new' for A:Module but it does in MacRuby returning an instance of A:Module which responds to the meth1 call => #<A:0x2003da160> a.meth1 =>"hello" -- Ticket URL: <http://www.macruby.org/trac/ticket/371#comment:1> MacRuby <http://macruby.org/>
#371: Module methods included in the class Module are not visible to other classes. ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): These are 2 different bugs. -- Ticket URL: <http://www.macruby.org/trac/ticket/371#comment:2> MacRuby <http://macruby.org/>
#371: Module methods included in the class Module are not visible to other classes. ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by keith.gautreaux@…): I'm sorry Laurent. I will open a separate ticket for the second bug. Thanks. -- Ticket URL: <http://www.macruby.org/trac/ticket/371#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby