X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=e2eb4bf7b2c1e0d58b2ffa820c3829cea1e80074;hb=df7e47294bc932e837f0548f61125e84fe56eb94;hp=b1cffd86a2acaa032eccfc1ed6df92ab77de53ae;hpb=913b59645bf5e7f16128c0e20711090a43676096;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index b1cffd8..e2eb4bf 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -209,9 +209,13 @@ sub add_attribute { weaken( $attr->{associated_class} = $self ); - $self->{attributes}{$attr->name} = $attr; + # install accessors first $attr->install_accessors(); + # then register the attribute to the metaclass + $attr->{insertion_order} = keys %{ $self->{attributes} }; + $self->{attributes}{$attr->name} = $attr; + if(!$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){ Carp::carp(qq{Attribute ($name) of class }.$self->name .qq{ has no associated methods (did you mean to provide an "is" argument?)}); @@ -258,8 +262,6 @@ sub make_immutable { $self->{is_immutable}++; - $self->{strict_constructor} = $args{strict_constructor}; - if ($args{inline_constructor}) { $self->add_method($args{constructor_name} => Mouse::Util::load_class($self->constructor_class) @@ -488,7 +490,7 @@ Mouse::Meta::Class - The Mouse class metaclass =head1 VERSION -This document describes Mouse version 0.61 +This document describes Mouse version 0.63 =head1 METHODS