From: Eric Wilhelm Date: Sun, 6 Aug 2006 00:29:03 +0000 (+0000) Subject: lib/Moose/Meta/Attribute.pm - fixed various spellings of constraint X-Git-Tag: 0_12~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8449e6e75adafe1b29b95c20c767081a9eb37ff1;p=gitmo%2FMoose.git lib/Moose/Meta/Attribute.pm - fixed various spellings of constraint --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index c806cde..620d1c0 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -211,7 +211,7 @@ sub initialize_instance_slot { (defined($type_constraint->check($val))) || confess "Attribute (" . $self->name . - ") does not pass the type contraint (" . + ") does not pass the type constraint (" . $type_constraint->name . ") with '$val'"; } @@ -231,7 +231,7 @@ sub _inline_check_constraint { # FIXME - remove 'unless defined($value) - constraint Undef return sprintf <<'EOF', $value, $value, $value, $value defined($attr->type_constraint->check(%s)) - || confess "Attribute (" . $attr->name . ") does not pass the type contraint (" + || confess "Attribute (" . $attr->name . ") does not pass the type constraint (" . $attr->type_constraint->name . ") with " . (defined(%s) ? "'%s'" : "undef") if defined(%s); EOF @@ -509,7 +509,7 @@ will behave just as L does. =head2 Additional Moose features -Moose attributes support type-contstraint checking, weak reference +Moose attributes support type-constraint checking, weak reference creation and type coercion. =over 4