[MacRuby] #555: Redefinition of method gives unexpected behavior
#555: Redefinition of method gives unexpected behavior --------------------------------+------------------------------------------- Reporter: maccheck@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- When I run following test program with Ruby 1.9.1/1.8.7 and MacRuby 0.5b2 I get an unexpected result: {{{ class TestClass def initialize; @a_var = "content"; end end a = TestClass.new; puts "a: %s" % a.inspect class TestClass def initialize(k); @a_var = k; end end b = TestClass.new "valueGiven"; puts "b: %s" % b.inspect c = TestClass.new; puts "c: %s" % c.inspect }}} results in Ruby 1.9.1/1.8.7 with the expected behavior: {{{ a: #<TestClass:0x100155d50 @a_var="content"> b: #<TestClass:0x100155b20 @a_var="valueGiven"> initTest.rb:13:in `initialize': wrong number of arguments (0 for 1) (ArgumentError) from initTest.rb:13:in `new' from initTest.rb:13 }}} In MacRuby I get following output: {{{ a: ##-<TestClass:0x200020b60 @a_var="content"> b: ##-<TestClass:0x2000213e0 @a_var="valueGiven"> c: ##-<TestClass:0x200021820 @a_var="content"> }}} It seems that {{{#initialize}}} (without arguments) is still floating around... -- Ticket URL: <http://www.macruby.org/trac/ticket/555> MacRuby <http://macruby.org/>
#555: Redefinition of method gives unexpected behavior --------------------------------+------------------------------------------- Reporter: maccheck@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Changes (by martinlagardette@…): * status: new => closed * resolution: => fixed Comment: Hi, thanks for the report! This should be fixed with r3572 :-). Thank you! -- Ticket URL: <http://www.macruby.org/trac/ticket/555#comment:1> MacRuby <http://macruby.org/>
#555: Redefinition of method gives unexpected behavior --------------------------------+------------------------------------------- Reporter: maccheck@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 0.5 => MacRuby 0.6 -- Ticket URL: <http://www.macruby.org/trac/ticket/555#comment:2> MacRuby <http://macruby.org/>
#555: Redefinition of method gives unexpected behavior --------------------------------+------------------------------------------- Reporter: maccheck@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Comment(by maccheck@…): I can confirm the fix with the latest nightly build. -- Ticket URL: <http://www.macruby.org/trac/ticket/555#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby