[MacRuby] #609: Constants and methods are not copied when cloning modules
#609: Constants and methods are not copied when cloning modules ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ clone_test.rb {{{ module A CONST_A = 1 def method_a; end end B = A.clone [A, B].each {|m| puts "#{m}, #{m.constants}, #{m.instance_methods(false)}"} }}} results {{{ $ ruby clone_test.rb A, [:CONST_A], [:method_a] B, [:CONST_A], [:method_a] $ macruby clone_test.rb A, [:CONST_A], [:method_a] B, [], [] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/609> MacRuby <http://macruby.org/>
#609: Constants and methods are not copied when cloning modules ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by martinlagardette@…): Hi! Thanks for the bug report :-) I analyzed the issue a little bit, and it seems that module cloning was not the only issue.[[BR]] We actually had issues with class & modules `#clone` & `#dup`. I uploaded a script to tests the issues we had. I also uploaded a temporary diff for Laurent to check. The only issue left is that `#dup` also dups the class/module path/name, which is not correct. However, since it is using ObjC's `+copy` method, I don't really know (yet) how to correct the problem :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/609#comment:1> MacRuby <http://macruby.org/>
#609: Constants and methods are not copied when cloning modules ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by martinlagardette@…): Just to explain what issues the diff tries to correct: - in `class.c`, it actually copies the methods and the constants when a module or a class is copied[[BR]] - in `vm.cpp`, it removes an apparently wrong loop, which made the return of `m. instance_methods(false)` invalid. -- Ticket URL: <http://www.macruby.org/trac/ticket/609#comment:2> MacRuby <http://macruby.org/>
#609: Constants and methods are not copied when cloning modules ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): Looks good, please go ahead and commit :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/609#comment:3> MacRuby <http://macruby.org/>
#609: Constants and methods are not copied when cloning modules ---------------------------------+------------------------------------------ Reporter: mred@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------------+------------------------------------------ Changes (by martinlagardette@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: r3475 should fix this bug :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/609#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby