[BUG FIXES]
- * Re-declaring a class_type constraint that has been already declared
- now just returns the original type constraint, rather than replacing
- the original constraint and ergo losing any coercions that were on
+ * Re-declaring a class_type or role_type constraint that has already been
+ declared now just returns the original type constraint, rather than
+ replacing the original constraint and ergo losing any coercions that were on
the original constraint. (t0m)
2.0402 Sat, Feb 04, 2012
ok( !$type->equals(Moose::Meta::TypeConstraint::Role->new( name => "__ANON__", role => "Bar" )), "doesn't equal other anon constraint" );
ok( $type->is_subtype_of(Moose::Meta::TypeConstraint::Role->new( name => "__ANON__", role => "Bar" )), "subtype of other anon constraint" );
+{ # See block comment in t/type_constraints/class_type_constraint.t
+ my $type;
+ is( exception { $type = role_type 'MyExampleRole' }, undef, 'Make initial role_type' );
+ is( exception { is(role_type('MyExampleRole'), $type, 're-running role_type gives same type') }, undef, 'No exception making duplicate role_type' );;
+}
+
done_testing;