Subject: | Bug when combining class_has, inheritance and default sub |
Hi,
I've written a test that demostrates unexpected behaviour when combining class_has, inheritance and default => sub {}.
I've specified a class_has "attributes" in a base class, that inspects the class to find it's attributes.
If I inherit from the base class, and call attributes on the subclass, I get the correct answer. The bug ocurs when later I call attributes on the base class: it returns the attributes for the subclass.
The order in which the "attributes" class_has is called on the classes influences the results of the class_has methods (the first one to get calculated prevails). I would expect that every class (inherited or not) has it's own "attributes" value.
I've written a test so you can review if the current behaviour is a bug or not: https://github.com/pplu/MooseX-ClassAttribute/commit/386b3e423710ff957a7de9c70bda2636158309be
Best Regards,
Jose Luis Martinez
JLMARTIN on CPAN