From: Dave Rolsky Date: Fri, 26 Jun 2009 16:41:08 +0000 (-0500) Subject: Make the MM::TC::Role type object's parent Object rather than the X-Git-Tag: 0.85~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f37d0936d1444c462981aedbad75e4e607b9a697;p=gitmo%2FMoose.git Make the MM::TC::Role type object's parent Object rather than the now-deprecated Role. Since it provides an optimized constraint, the parent doesn't really matter anyway. --- diff --git a/lib/Moose/Meta/TypeConstraint/Role.pm b/lib/Moose/Meta/TypeConstraint/Role.pm index 57176e5..71c7d58 100644 --- a/lib/Moose/Meta/TypeConstraint/Role.pm +++ b/lib/Moose/Meta/TypeConstraint/Role.pm @@ -20,7 +20,7 @@ __PACKAGE__->meta->add_attribute('role' => ( sub new { my ( $class, %args ) = @_; - $args{parent} = Moose::Util::TypeConstraints::find_type_constraint('Role'); + $args{parent} = Moose::Util::TypeConstraints::find_type_constraint('Object'); my $self = $class->_new(\%args); $self->_create_hand_optimized_type_constraint; diff --git a/t/040_type_constraints/024_role_type_constraint.t b/t/040_type_constraints/024_role_type_constraint.t index f20f68d..6273f54 100644 --- a/t/040_type_constraints/024_role_type_constraint.t +++ b/t/040_type_constraints/024_role_type_constraint.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 19; +use Test::More tests => 18; use Test::Exception; BEGIN { @@ -44,7 +44,6 @@ ok( $type->is_subtype_of("Gorch"), "subtype of gorch" ); ok( $type->is_subtype_of("Bar"), "subtype of bar" ); ok( $type->is_subtype_of("Object"), "subtype of Object" ); -ok( $type->is_subtype_of("Role"), "subtype of Role" ); ok( !$type->is_subtype_of("ThisTypeDoesNotExist"), "not subtype of unknown type name" ); ok( !$type->is_a_type_of("ThisTypeDoesNotExist"), "not type of unknown type name" );