From: Dave Rolsky Date: Wed, 14 Jul 2010 16:22:23 +0000 (-0500) Subject: Deprecate the Role type X-Git-Tag: 1.09~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0eb7894a222c1d55c583a867bb6fad21d6927b2c;p=gitmo%2FMoose.git Deprecate the Role type --- diff --git a/lib/Moose/Deprecated.pm b/lib/Moose/Deprecated.pm index d2db110..a51f072 100644 --- a/lib/Moose/Deprecated.pm +++ b/lib/Moose/Deprecated.pm @@ -10,6 +10,7 @@ our $AUTHORITY = 'cpan:STEVAN'; use Package::DeprecationManager -deprecations => { 'pre-0.94 MetaRole API' => '0.93', 'Moose::Exporter with_caller' => '0.89', + 'Role type' => '0.84', }, -ignore => [qw( Moose Moose::Exporter Moose::Util::MetaRole )], ; diff --git a/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm b/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm index 55662ee..b0ece33 100644 --- a/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm +++ b/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm @@ -36,7 +36,14 @@ sub FileHandle { ref($_[0]) eq 'GLOB' && Scalar::Util::openhandle($_[0]) or bles sub Object { blessed($_[0]) && blessed($_[0]) ne 'Regexp' } -sub Role { Carp::cluck('The Role type is deprecated.'); blessed($_[0]) && $_[0]->can('does') } +sub Role { + Moose::Deprecated::deprecated( + feature => 'Role type', + message => + 'The Role type has been deprecated. Maybe you meant to create a RoleName type?' + ); + blessed( $_[0] ) && $_[0]->can('does'); +} sub ClassName { return Class::MOP::is_class_loaded( $_[0] );