[MacRuby] #516: Subclasses can't access the class variables of their superclass.
#516: Subclasses can't access the class variables of their superclass. ------------------------------+--------------------------------------------- Reporter: pygy79@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- At the end of the following story, the heir is rich in MRI, but not in MacRuby. The MRI behaviour is described in the "Ruby Programming Language" book written by Matz and D. Flanagan, (section 7.3.6). {{{ class FilthyRichGramp def self.passes_away @@heritage="Brazillions of $!" puts "* Gramp dies : (\"Aaaargh...\") \n\n" end end class UnluckyHeir < FilthyRichGramp def self.wallet cash = "0 $." cash = @@heritage if defined? @@heritage puts "Lil' bastard: I now have #{cash} \n\n" end end UnluckyHeir.wallet FilthyRichGramp.passes_away UnluckyHeir.wallet }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/516> MacRuby <http://macruby.org/>
#516: Subclasses can't access the class variables of their superclass. ------------------------------+--------------------------------------------- Reporter: pygy79@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------+--------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed Comment: Thanks for the report, should be fixed by r3158. -- Ticket URL: <http://www.macruby.org/trac/ticket/516#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby