[Moose-commits] r7846 - Mouse/trunk/lib/Mouse/Meta
lestrrat at code2.0beta.co.uk
lestrrat at code2.0beta.co.uk
Sat Mar 7 09:06:58 GMT 2009
Author: lestrrat
Date: 2009-03-07 01:06:57 -0800 (Sat, 07 Mar 2009)
New Revision: 7846
Modified:
Mouse/trunk/lib/Mouse/Meta/Attribute.pm
Log:
properly commit the newly created parameterized type to the registry (cache!)
Modified: Mouse/trunk/lib/Mouse/Meta/Attribute.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2009-03-07 08:40:26 UTC (rev 7845)
+++ Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2009-03-07 09:06:57 UTC (rev 7846)
@@ -191,10 +191,10 @@
return \%method_map;
}
-our $optimized_constraints;
+my $optimized_constraints;
sub _build_type_constraint {
my $spec = shift;
- local $optimized_constraints ||= Mouse::Util::TypeConstraints->optimized_constraints;
+ $optimized_constraints ||= Mouse::Util::TypeConstraints->optimized_constraints;
my $code;
if ($spec =~ /^([^\[]+)\[(.+)\]$/) {
# parameterized
@@ -233,6 +233,7 @@
} else {
Carp::confess("Support for parameterized types other than ArrayRef or HashRef is not implemented yet");
}
+ $optimized_constraints->{$spec} = $code;
} else {
$code = $optimized_constraints->{ $spec };
if (! $code) {
More information about the Moose-commits
mailing list