From: gfx Date: Thu, 8 Oct 2009 11:19:58 +0000 (+0900) Subject: Fix a possible syntax error in generated constructor X-Git-Tag: 0.37_04~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=620c3203b30d5e7644acd8769db61991edffc251;p=gitmo%2FMouse.git Fix a possible syntax error in generated constructor --- diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index 97e1603..a7fd556 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -83,7 +83,7 @@ sub _generate_processattrs { $code .= "if (exists $value) {\n"; if($need_coercion){ - $value = "$instance_slot = $constraint_var->coerce($value);\n"; + $value = "$constraint_var->coerce($value)"; } $code .= "$instance_slot = $value;\n"; @@ -91,7 +91,7 @@ sub _generate_processattrs { if ($attr->has_trigger) { $has_triggers++; - $code .= "push \@triggers, [$attr_var\->{trigger}, $value];\n"; + $code .= "push \@triggers, [$attr_var\->{trigger}, $instance_slot];\n"; } $code .= "\n} else {\n";