[MacRuby] #1403: Modules included indirectly get included twice
#1403: Modules included indirectly get included twice ----------------------------------------+----------------------------------- Reporter: ernest.prabhakar@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- If module Bar includes Foo, then anything that includes Bar includes Foo twice. {{{ #!/usr/bin/env ruby module Foo def singleton; class << self; self; end; end end module Bar include Foo end class Array include Bar end puts Array.ancestors s = "\nDone\n".extend(Bar) puts s puts s.singleton.ancestors }}} {{{ prabhaka$ rvm current macruby-0.10 prabhaka$ ruby spec/include_test.rb Array Bar Foo Foo NSMutableArray NSArray Enumerable NSObject Kernel }}} This does not have with 1.8 or 1.9. It may be related to #718 {{{ prabhaka$ rvm current ruby-1.9.2-p180 prabhaka$ ruby spec/include_test.rb Array Bar Foo Enumerable Object Kernel BasicObject }}} This occurs whether the module is included in a class or extending an instance. -- Ticket URL: <http://www.macruby.org/trac/ticket/1403> MacRuby <http://macruby.org/>
#1403: Modules included indirectly get included twice ----------------------------------------+----------------------------------- Reporter: ernest.prabhakar@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Description changed by ernest.prabhakar@…: Old description:
If module Bar includes Foo, then anything that includes Bar includes Foo twice.
{{{ #!/usr/bin/env ruby module Foo def singleton; class << self; self; end; end end
module Bar include Foo end
class Array include Bar end puts Array.ancestors s = "\nDone\n".extend(Bar) puts s puts s.singleton.ancestors }}}
{{{ prabhaka$ rvm current macruby-0.10
prabhaka$ ruby spec/include_test.rb Array Bar Foo Foo NSMutableArray NSArray Enumerable NSObject Kernel }}} This does not have with 1.8 or 1.9. It may be related to #718
{{{ prabhaka$ rvm current ruby-1.9.2-p180
prabhaka$ ruby spec/include_test.rb Array Bar Foo Enumerable Object Kernel BasicObject }}}
This occurs whether the module is included in a class or extending an instance.
New description: If module Bar includes Foo, then anything that includes Bar includes Foo twice. {{{ prabhaka$ rvm current macruby-0.10 prabhaka$ ruby spec/include_test.rb Array Bar Foo Foo NSMutableArray NSArray Enumerable NSObject Kernel }}} This does not happen with 1.8 or 1.9. It may be related to #718 {{{ prabhaka$ rvm current ruby-1.9.2-p180 prabhaka$ ruby spec/include_test.rb Array Bar Foo Enumerable Object Kernel BasicObject }}} This occurs whether the module is included in a class or extending an instance. {{{ #!/usr/bin/env ruby module Foo def singleton; class << self; self; end; end end module Bar include Foo end class Array include Bar end puts Array.ancestors }}} -- -- Ticket URL: <http://www.macruby.org/trac/ticket/1403#comment:1> MacRuby <http://macruby.org/>
#1403: Modules included indirectly get included twice ----------------------------------------+----------------------------------- Reporter: ernest.prabhakar@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by ernest.prabhakar@…): Still present with MacRuby v0.11 first Release Candidate. -- Ticket URL: <http://www.macruby.org/trac/ticket/1403#comment:2> MacRuby <http://macruby.org/>
#1403: Modules included indirectly get included twice ----------------------------------------+----------------------------------- Reporter: ernest.prabhakar@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by watson1978@…): I had improved this issue in https://github.com/MacRuby/MacRuby/commit/677f704206497cbe9d65d7ba088a8d283d... [[BR]] {{{ module Dog; end module Core #include Dog end module Factory include Core end class Cat include Factory end p Cat.ancestors }}} {{{ $ ruby19 t.rb [Cat, Factory, Core, Object, Kernel, BasicObject] $ macruby t.rb [Cat, Factory, Core, NSObject, Kernel] }}} but, still strange ancestors are display if there is more complex including. {{{ module Dog; end module Core include Dog end module Factory include Core end class Cat include Factory end p Cat.ancestors }}} {{{ $ ruby19 t.rb [Cat, Factory, Core, Dog, Object, Kernel, BasicObject] $ macruby t.rb [Cat, Factory, Dog, Core, Dog, NSObject, Kernel] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1403#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby