Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #39056] [BUG] vtable override doesn't work in sub-subclasses

5 views
Skip to first unread message

Patrick R . Michaud

unread,
May 2, 2006, 6:30:29 PM5/2/06
to bugs-bi...@rt.perl.org
# 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

Leopold Toetsch

unread,
May 25, 2006, 6:21:13 AM5/25/06
to perl6-i...@perl.org, Patrick R.Michaud (via RT), bugs-bi...@netlabs.develooper.com
Am Mittwoch, 3. Mai 2006 00:30 schrieb Patrick R.Michaud (via RT):
> 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:

Fixed now in r12797.

Thanks for the test.
leo

0 new messages