Test RegexpRef type using SvRX or checking PERL_magic_qr
authorDavid Leadbeater <dgl@dgl.cx>
Mon, 4 Apr 2011 23:47:02 +0000 (00:47 +0100)
committerFlorian Ragwitz <rafl@debian.org>
Sat, 9 Apr 2011 15:50:23 +0000 (17:50 +0200)
commit7c29582bacf33dd829d2e9c2d46bf95e92aed32f
tree0a4feddeefeb2c4bf4e67da007939fa84e8dad1d
parentfb75f80e395b0affb7b8b42e8c16b5194fc4dfb6
Test RegexpRef type using SvRX or checking PERL_magic_qr

With pluggable regexp engines checking "ref" of a qr// isn't correct;
it's also possible for a normal Regex to be blessed into another
class.

Additionally an 'Object' subtype previously excluded objects that were
->isa('Regexp'), this was inconsistent with the RegexpRef handling
(i.e. neither RegexpRef nor isa => 'Regexp' would accept a subclass of
Regexp). The 'Object' subtype now simply checks if the reference is
blessed with no special logic.
Changes
lib/Moose/Meta/TypeConstraint/Class.pm
lib/Moose/Util/TypeConstraints.pm
lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm
t/type_constraints/class_type_constraint.t
t/type_constraints/util_std_type_constraints.t
xs/Moose.xs