Skip Menu |
 

This queue is for tickets about the Class-Virtual CPAN distribution.

Report information
The Basics
Id: 6300
Status: open
Priority: 0/
Queue: Class-Virtual

People
Owner: Nobody in particular
Requestors: jonasbn [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.04
Fixed in: (no value)



Subject: Problems with multiple inheritance
Download (untitled) / with headers
text/plain 1007b
This problem was experienced in Class::Virtually::Abstract. Perl: This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level (with 1 registered patch, see perl -V for more detail) OS: Darwin hyperstation.local 7.3.0 Darwin Kernel Version 7.3.0: Fri Mar 5 14:22:55 PST 2004; root:xnu/xnu-517.3.15.obj~4/RELEASE_PPC Power Macintosh powerpc I have implemented and abstract class, a parent class and a child class. The abstract class requires four different subs to be implemented: init, proces, finish and fail. The parent class implements: init, finish and fail. The goal is to only have this particular child class implementing proces and inheriting the remaining: init, finish and fail from the parent class. The abstract class does it job (failing) until I declare that the child class ISA parent class, then everything compiles correctly. The parent class does not implement the required proces - I suspect this has to do with the import, but I am not sure. So this bug is just for the record.
Download (untitled) / with headers
text/plain 808b
[JONASBN - Fri May 14 05:22:07 2004]: Show quoted text
> I have implemented and abstract class, a parent class and a child > class. The abstract class requires four different subs to be > implemented: init, proces, finish and fail. > > The parent class implements: init, finish and fail. > > The goal is to only have this particular child class implementing > proces and inheriting the remaining: init, finish and fail from the > parent class. > > The abstract class does it job (failing) until I declare that the > child class ISA parent class, then everything compiles correctly. > The parent class does not implement the required proces - I suspect > this has to do with the import, but I am not sure. So this bug is > just for the record.
Do you have example source code to reproduce this?
Download (untitled) / with headers
text/plain 869b
On Fri May 14 05:22:07 2004, JONASBN wrote: Show quoted text
> This problem was experienced in Class::Virtually::Abstract.
... Show quoted text
> I have implemented and abstract class, a parent class and a child > class. The abstract class requires four different subs to be > implemented: init, proces, finish and fail. > > The parent class implements: init, finish and fail. > > The goal is to only have this particular child class implementing > proces and inheriting the remaining: init, finish and fail from the > parent class. > > The abstract class does it job (failing) until I declare that the > child class ISA parent class, then everything compiles correctly. > The parent class does not implement the required proces - I suspect > this has to do with the import, but I am not sure. So this bug is > just for the record.
Ping? Any example code to reproduce this?
Hi Schwern, I might be experincing some other problems with Class::Virtually::Abstract, but we should get this out of the way first. So here goes: I have the following packages implemented in separate files: package VirtualFoo; use base qw(Class::Virtually::Abstract); __PACKAGE__->virtual_methods(qw(ding dong)); 1; package SuperFoo; sub dong {}; 1; package SharonFoo; use vars qw(@ISA); use base qw(VirtualFoo); use SuperFoo; @ISA = qw(SuperFoo); #comment me out 1; package Boo; use SharonFoo; 1; We have an abstract class, a super class and a class inheriting form both. So we require ding and dong to be implemented in our abstract, The super class only implements dong, so ding should give an error, but it does not unless the SharonFoo does NOT inherit from the super class also. It work with plain use of abstract, but not if there is inherited from a super class in addition. compiling Boo.pm will tell and can demonstrate the two scenarios, just comment out the @ISA line in SharonFoo. Take care, jonasbn


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.