[MacRuby] #514: Singleton + Inheritance causes ArgumentError
#514: Singleton + Inheritance causes ArgumentError --------------------------------+------------------------------------------- Reporter: lastobelus@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Singleton, inheritance --------------------------------+------------------------------------------- Combining the use of Singleton with inheritance causes ArgumentError. This bug breaks log4r. == Steps to Reproduce == Use Singleton in a class that is a sub class. Example: {{{ require "singleton" class Mary end class Bob < Mary include Singleton end puts "Bob.instance: #{Bob.instance.inspect}" }}} == Result == {{{ core:in `new:': wrong number of arguments (6 for 0) (ArgumentError) from /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/1.9.0/singleton.rb:107:in `instance' from single2.rb:1:in `<main>' }}} Tested on 10.6 with beta 2 release, and 10.5.7 with r3131 -- Ticket URL: <http://www.macruby.org/trac/ticket/514> MacRuby <http://macruby.org/>
#514: Singleton + Inheritance causes ArgumentError --------------------------------+------------------------------------------- Reporter: lastobelus@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Singleton, inheritance --------------------------------+------------------------------------------- Comment(by mattaimonetti@…): confirmed on 10.6.2 / macruby trunk -- Ticket URL: <http://www.macruby.org/trac/ticket/514#comment:1> MacRuby <http://macruby.org/>
#514: Singleton + Inheritance causes ArgumentError --------------------------------+------------------------------------------- Reporter: lastobelus@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Singleton, inheritance --------------------------------+------------------------------------------- Comment(by lastobelus@…): In case anybody else really needs a configurable, hierarchical logger, I whipped one up to use until this bug is fixed. It is here: http://www.lastobelus.com/uncategorized/a-dirt-simple-hierarchical- configurable-logger-for-ruby -- Ticket URL: <http://www.macruby.org/trac/ticket/514#comment:2> MacRuby <http://macruby.org/>
#514: Singleton + Inheritance causes ArgumentError --------------------------------+------------------------------------------- Reporter: lastobelus@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Singleton, inheritance --------------------------------+------------------------------------------- Comment(by lsansonetti@…): The problem seems to be in the "call_method_missing" section of the dispatcher. +new is properly called but then -initialize is messaged with 6 arguments, strangely. -- Ticket URL: <http://www.macruby.org/trac/ticket/514#comment:3> MacRuby <http://macruby.org/>
#514: Singleton + Inheritance causes ArgumentError ------------------------------------+--------------------------------------- Reporter: lastobelus@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: Singleton, inheritance | ------------------------------------+--------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: The problem was in the method visibility change code path, should be fixed by r3161. {{{ $ ./miniruby -I./lib -e "require 'singleton'; class X; end; class Y<X; include Singleton; end; p Y.instance" #<Y:0x2000a2e20> }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/514#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby