projects
/
gitmo/Mouse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
9e94a14
)
Make type constraints always true
gfx [Fri, 30 Oct 2009 01:02:47 +0000 (10:02 +0900)]
lib/Mouse/Meta/TypeConstraint.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Mouse/Meta/TypeConstraint.pm
b/lib/Mouse/Meta/TypeConstraint.pm
index
0526163
..
30edadd
100644
(file)
--- 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