use warnings;
use metaclass;
+use B;
use Scalar::Util 'blessed';
use Moose::Util::TypeConstraints ();
reader => 'role',
));
+my $inliner = sub {
+ my $self = shift;
+ my $val = shift;
+
+ return
+ "Moose::Util::does_role( $val, " . B::perlstring( $self->role ) . ')';
+};
+
sub new {
my ( $class, %args ) = @_;
my $role_name = $args{role};
$args{constraint} = sub { Moose::Util::does_role( $_[0], $role_name ) };
+ $args{inlined} = $inliner;
+
my $self = $class->_new( \%args );
$self->_create_hand_optimized_type_constraint;