in reply to Introspection of Moose/Mouse attributes fails to find native trait with `does`

As I understand the docs, does() tests if it implements the named Role. I think you want isa().

Replies are listed 'Best First'.
Re^2: Introspection of Moose/Mouse attributes fails to find native trait with `does`
by perigrin (Sexton) on Aug 25, 2011 at 01:58 UTC
    No because isa() would return Moose::Meta::Attribute.
Re^2: Introspection of Moose/Mouse attributes fails to find native trait with `does`
by am0c (Initiate) on Aug 25, 2011 at 01:04 UTC
    I agree. And there is type_constraint() method to get Moose::Meta::TypeConstraint object for the attribute:
    print "Attribute does Bool? ", $attr->type_constraint->equals("Bool") +? "Yes!" : "No...", $/;
    It works well as expected.