Force parsing of blessed() as a function
[gitmo/Moose.git] / lib / Moose / Meta / Method / Constructor.pm
index aecd683..af6a1b4 100644 (file)
@@ -58,7 +58,7 @@ sub _initialize_body {
     $source .= "\n" . 'my $_instance = shift;';
 
     $source .= "\n" . q{Carp::cluck 'Calling new() on an instance is deprecated,'
-                        . ' please use (blessed $obj)->new' if blessed $_instance;};
+                        . ' please use (blessed $obj)->new' if Scalar::Util::blessed($_instance);};
 
     $source .= "\n" . 'my $class = Scalar::Util::blessed($_instance) || $_instance;';