Checking in changes prior to tagging of version 0.74.
[gitmo/Mouse.git] / lib / Mouse / Meta / Class.pm
index 187ba00..501c9ec 100644 (file)
@@ -1,5 +1,5 @@
 package Mouse::Meta::Class;
-use Mouse::Util qw/:meta get_linear_isa not_supported/; # enables strict and warnings
+use Mouse::Util qw/:meta/; # enables strict and warnings
 
 use Scalar::Util qw/blessed weaken/;
 
@@ -238,6 +238,12 @@ sub add_attribute {
         Carp::carp(qq{Attribute ($name) of class }.$self->name
             .qq{ has no associated methods (did you mean to provide an "is" argument?)});
     }
+
+    if(!Mouse::Util::MOUSE_XS) {
+        # in Mouse::PurePerl, attribute initialization code is cached, so it
+        # must be clear here. See _initialize_object() in Mouse::PurePerl.
+        delete $self->{_initialize_object};
+    }
     return $attr;
 }
 
@@ -275,8 +281,8 @@ sub make_immutable {
                 ->_generate_destructor($self, \%args));
     }
 
-    # Moose's make_immutable returns true allowing calling code to skip setting an explicit true value
-    # at the end of a source file. 
+    # Moose's make_immutable returns true allowing calling code to skip
+    # setting an explicit true value at the end of a source file.
     return 1;
 }
 
@@ -445,7 +451,7 @@ Mouse::Meta::Class - The Mouse class metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 0.70
+This document describes Mouse version 0.74
 
 =head1 DESCRIPTION