projects
/
gitmo/Mouse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Make type constraints always true
[gitmo/Mouse.git]
/
lib
/
Mouse
/
Meta
/
TypeConstraint.pm
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