From: Dave Rolsky Date: Wed, 28 Jan 2009 19:03:18 +0000 (+0000) Subject: Add changes for MUC change. X-Git-Tag: 0.66~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dba9208a3f38570b5e7379e75d5380241cfb1c55;p=gitmo%2FMoose.git Add changes for MUC change. Make sure MUC docs mention when it auto-vivifies a name as a class type. --- diff --git a/Changes b/Changes index 750ed11..339e856 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,12 @@ Revision history for Perl extension Moose - Added a delegation_metaclass method to replace a hard-coded use of Moose::Meta::Method::Delegation. (Dave Rolsky) + * Moose::Util::TypeConstraints + - If you created a subtype and passed a parent that Moose didn't + know about, it simply ignored the parent. Now it automatically + creates the parent as a class type. This may not be what you + want, but is less broken than before. (Dave Rolsky) + 0.65 Thu, January 22, 2008 * Moose and Moose::Meta::Method::Overridden - If an overridden method called super(), and then the diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 5219091..ca297d1 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -395,7 +395,7 @@ sub _create_type_constraint ($$$;$$) { my $constraint; if ( defined $parent and $parent - = blessed $parent ? $parent : find_or_parse_type_constraint($parent) ) + = blessed $parent ? $parent : find_or_create_isa_type_constraint($parent) ) { $constraint = $parent->create_child_type(%opts); } @@ -838,6 +838,9 @@ This creates a base type, which has no parent. This creates a named subtype. +If you provide a parent that Moose does not recognize, it will +automatically create a new class type constraint for this name. + =item B This creates an unnamed subtype and will return the type