Subject: | Method generators + Class::Trait == no love |
Consider the following.
package TTest;
use Class::Trait 'base';
use base qw(Class::Accessor);
__PACKAGE__->mk_accessors(qw(foo));
1;
Doesn't work. It appears that Class::Trait considers foo() to be
"imported" since the code ref was generated in another package.
Compare with the following, which does work showing its not the run-time
declaration.
package TTest;
use Class::Trait 'base';
*foo = sub { 42 }
1;
The following does not work showing that it is, in fact, the code ref.
package TTest;
use Class::Trait 'base';
use base qw(Class::Accessor);
__PACKAGE__->mk_accessors(qw(bar));
*foo = \&bar;
1;
I don't know if this is fixable, but its worth noting as a caveat.