Also see Moose::Manual::Delta for more details of, and workarounds
for, noteworthy changes.
+ [BUG FIXES]
+
+ * Make Moose::Meta::TypeConstraint::Class correctly reject RegexpRefs.
+ (Florian Ragwitz)
+
1.01 Fri, Mar 26, 2010
[NEW FEATURES]
my $class = $self->class;
$self->hand_optimized_type_constraint(
sub {
- blessed( $_[0] ) && $_[0]->isa($class)
+ blessed( $_[0] ) && blessed( $_[0] ) ne 'Regexp' && $_[0]->isa($class)
}
);
}
ok( !$type->equals(Moose::Meta::TypeConstraint::Class->new( name => "__ANON__", class => "Bar" )), "doesn't equal other anon constraint" );
ok( $type->is_subtype_of(Moose::Meta::TypeConstraint::Class->new( name => "__ANON__", class => "Bar" )), "subtype of other anon constraint" );
+{
+ my $regexp_type = Moose::Meta::TypeConstraint::Class->new(name => 'Regexp', class => 'Regexp');
+ ok(!$regexp_type->check(qr//), 'a Regexp is not an instance of a class, even tho perl pretends it is');
+}
+
done_testing;