foo
[gitmo/Moose.git] / lib / Moose / Meta / Method / Constructor.pm
index 4553078..1fcc5ab 100644 (file)
@@ -202,7 +202,8 @@ sub _generate_type_constraint_check {
     return (
         'defined(' . $type_constraint_name . '->_compiled_type_constraint->(' . $value_name . '))'
        . "\n\t" . '|| confess "Attribute (' . $attr->name . ') does not pass the type constraint ('
-        . $attr->type_constraint->name . ') with " . (defined() ? "' . $value_name . '" : "undef");'
+        . $attr->type_constraint->name 
+        . ') with " . (defined(' . $value_name . ') ? (overload::Overloaded(' . $value_name . ') ? overload::StrVal(' . $value_name . ') : ' . $value_name . ') : "undef");'
     );    
 }