Improve the error message of having a plain reference in 'default'
[gitmo/Class-MOP.git] / lib / Class / MOP / Attribute.pm
index c3d760b..02cfae9 100644 (file)
@@ -41,7 +41,7 @@ sub new {
     } else {
         (is_default_a_coderef(\%options))
             || confess("References are not allowed as default values, you must ".
-                       "wrap then in a CODE reference (ex: sub { [] } and not [])")
+                       "wrap the default of '$name' in a CODE reference (ex: sub { [] } and not [])")
                 if exists $options{default} && ref $options{default};
     }
     if( $options{required} and not( defined($options{builder}) || defined($options{init_arg}) || exists $options{default} ) ) {