http://www.perlmonks.org?node_id=922337


in reply to Re^2: Introspection of Moose/Mouse attributes fails to find native trait with `does`
in thread Introspection of Moose/Mouse attributes fails to find native trait with `does`

Basically (and perigrin already said this sorta), the OP is introspecting a meta-object, not any kind of prototypical value that would be stored by the attribute. So really, there should be no reason that $attr->does('Bool') using the traditional meaning of does.

Next, the whole traits => ['Bool'] thing needs to be understood. By adding the 'Bool' trait to the attribute you are really just asking Moose to (optionally) provide delegate-able methods (specific in this case to Bool values). So in this particular case you could do the following:

has 'guernsey' => ( traitls => [ 'Bool' ], is => 'rw', isa => 'Bool', handles => { be_a_guersey => 'set', dont_be_a_guernsey => 'unset', } );
Which would then allow the OP to do:
my $cow = MyCow->new; $cow->be_a_guernsey();
and get exactly the same behavior as his old code. Basically the Native Traits are only related to types in that they provide specific sets of behaviors for some native Perl types. And they are only related to roles in that they are implemented as roles that are applied to the attribute meta-object.

So, while I can see that these things can be a little misleading initially. Once you learn what all the pieces are made of, and roughly how they fit together, it should make sense going forward because it is really pretty consistent.

-stvn