From: gfx Date: Fri, 30 Oct 2009 01:02:47 +0000 (+0900) Subject: Make type constraints always true X-Git-Tag: 0.40_03~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c489a4771291bba160fa598a9293e1efdfc41c2e;p=gitmo%2FMouse.git Make type constraints always true --- diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index 0526163..30edadd 100644 --- a/lib/Mouse/Meta/TypeConstraint.pm +++ b/lib/Mouse/Meta/TypeConstraint.pm @@ -2,6 +2,8 @@ package Mouse::Meta::TypeConstraint; use Mouse::Util qw(:meta); # enables strict and warnings use overload + 'bool' => sub { 1 }, # always true + '""' => sub { $_[0]->name }, # stringify to tc name '|' => sub { # or-combination