Subject: | inheriting traits? |
Not sure whether this is a bug, probably more a wishlist or
misunderstanding. Probably I am a bit mislead by
http://www.oreillynet.com/onlamp/blog/2006/08/perl_module_review_classtrait.html
I wonder why it is not possible to inherit traits:
package T1;
use Class::Trait 'base';
sub t1 { return "1"; }
package T2;
use base 'T1';
sub t2 { return "2"; }
1;
package Mine;
use Class::Trait qw(T2);
sub new {
return bless {}, shift;
}
1;
$tt = new Mine;
warn "oops" unless $tt->does ('T1');
warn $tt->t1;
#----
Thanks for this package.
\rho