projects
/
gitmo/Moose.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
4ee48f8
)
Don't try to inline a coercion unless the type constraint has a coercion
Dave Rolsky [Mon, 19 Jul 2010 17:01:28 +0000 (12:01 -0500)]
lib/Moose/Meta/Method/Accessor.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moose/Meta/Method/Accessor.pm
b/lib/Moose/Meta/Method/Accessor.pm
index
7b6517a
..
fa637b2
100644
(file)
--- a/
lib/Moose/Meta/Method/Accessor.pm
+++ b/
lib/Moose/Meta/Method/Accessor.pm
@@
-166,7
+166,7
@@
sub _inline_check_coercion {
my $attr = $self->associated_attribute;
- return '' unless $attr->should_coerce;
+ return '' unless $attr->should_coerce && $attr->type_constraint->has_coercion;
return "$value = \$attr->type_constraint->coerce($value);";
}