X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FConstructor.pm;h=6b1d7c22b1101b8f45705f78d4739f3f9440fbe2;hb=c40e4359e7a5ad21af41e42c5a3746c193da9777;hp=693c8229d5fd929369a4780a2af5b3b6c35bd69e;hpb=78fa4d7d42dd85e1c36511a8e0d0b66ca23bb12b;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 693c822..6b1d7c2 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -74,11 +74,18 @@ sub _eval_environment { defined $_ ? $_->_compiled_type_constraint : undef; } @type_constraints; + my @type_coercions = map { + defined $_ && $_->has_coercion + ? $_->coercion->_compiled_type_coercion + : undef + } @type_constraints; + return { '$meta' => \$self, '$attrs' => \$attrs, '$defaults' => \$defaults, '@type_constraints' => \@type_constraints, + '@type_coercions' => \@type_coercions, '@type_constraint_bodies' => \@type_constraint_bodies, ( map { defined($_) ? %{ $_->inline_environment } : () } @type_constraints ),