Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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
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.
[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?
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