Use $value instead of $_ in the constructor, since $_ is getting
Shawn M Moore [Wed, 15 Apr 2009 06:41:36 +0000 (02:41 -0400)]
clobbered

lib/Mouse/Meta/Method/Constructor.pm

index 8d110da..d205492 100644 (file)
@@ -61,7 +61,7 @@ sub _generate_processattrs {
                 }
                 $code .= "
                         \$attrs[$index]->verify_type_constraint_error(
-                            '$key', \$_, \$attrs[$index]->type_constraint
+                            '$key', \$value, \$attrs[$index]->type_constraint
                         )
                     }
                 ";
@@ -117,7 +117,7 @@ sub _generate_processattrs {
                 if ($attr->has_type_constraint) {
                     $code .= "{
                         unless (\$attrs[$index]->{type_constraint}->check(\$value)) {
-                            \$attrs[$index]->verify_type_constraint_error('$key', \$_, \$attrs[$index]->type_constraint)
+                            \$attrs[$index]->verify_type_constraint_error('$key', \$value, \$attrs[$index]->type_constraint)
                         }
                     }";
                 }