# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #39056]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39056 >


Vtable overrides don't appear to work in a once-removed subclass
(i.e., a subclass of a subclass).  It's easiest to explain with
code:

    $ cat z.pir
    .sub main :main
        .local pmc base
        $P0 = getclass 'Integer'
        base = subclass $P0, 'Foo'          # create subclass 'Foo'
        addattribute base, '@!capt'
    
        $P0 = subclass 'Foo', 'Bar'         # create subclass 'Bar'
        $P1 = new 'Bar'                     # create an instance of 'Bar'
    
        $S1 = $P1                           # get its string representation
        print $S1                           # display it
        print "\n"
    .end
    
    
    .namespace [ 'Bar' ]
    
    .sub '__get_string' :method
        $S0 = 'ok bar'
        .return ($S0)
    .end
    
    $ ./parrot z.pir
    0
    $                                                                           
                    

I expect that I should get 'ok bar' as output here instead of '0'.  
However, if the intermediate class 'Foo' above defines a 
'__get_string' method, then everything works as expected.

I'll add this to the Parrot test suite as soon as I get the 
RT ticket number.

Pm

Reply via email to