projects
/
gitmo/Moose.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
74397c1
)
if something is already matching the type constraint, don't coerce it
Hans Dieter Pearcey [Fri, 24 Apr 2009 20:05:33 +0000 (16:05 -0400)]
lib/Moose/Meta/TypeConstraint.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moose/Meta/TypeConstraint.pm
b/lib/Moose/Meta/TypeConstraint.pm
index
1671d07
..
559ef20
100644
(file)
--- a/
lib/Moose/Meta/TypeConstraint.pm
+++ b/
lib/Moose/Meta/TypeConstraint.pm
@@
-82,6
+82,8
@@
sub coerce {
Moose->throw_error("Cannot coerce without a type coercion");
}
+ return $_[0] if $self->check($_[0]);
+
return $coercion->coerce(@_);
}