Subject: | Diamond-inherited exceptions fail to maintain some extra fields |
The attached patch is avaliable for version 1.26.
Exception-Class-1.26
perl 5.8.8, built on Gentoo as dev-lang/perl-5.8.8-r5 with USE flags:
berkdb gdbm ithreads -build -debug -doc -elibc_FreeBSD -perlsuid
2.6.26-gentoo-r1
Some extra fields appear to get lost during diamond inheritance.
If an exception A is the common ancestor of exceptions B and C, which
in turn are parents of an exception D, then there's no way to
instantiate an exception D with fields either from B or from C (it
depends on the order they appear in @ISA). It is Method Resolution
Order to blame.
There's sub Fields eval'd during creation of each exception package.
It invokes SUPER::Fields which is wrong regarding multiple inheritance.
Exception::Class::Base is thrown with the message
'unknown field ... passed to constructor for class ...'
when the exception class to be instantiated has the right field and
corresponding accessor method.