# then register the attribute to the metaclass
$attr->{insertion_order} = keys %{ $self->{attributes} };
$self->{attributes}{$name} = $attr;
- delete $self->{_mouse_cache}; # clears internal cache
+ $self->_invalidate_metaclass_cache();
if(!$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){
Carp::carp(qq{Attribute ($name) of class }.$self->name
sub strict_constructor;
*strict_constructor = $generate_class_accessor->('strict_constructor');
+sub _invalidate_metaclass_cache {
+ my($self) = @_;
+ delete $self->{_mouse_cache};
+ return;
+}
+
sub _report_unknown_args {
my($metaclass, $attrs, $args) = @_;
mouse_class_initialize_object(aTHX_ meta, object, args, is_cloning);
}
+void
+_invalidate_metaclass_cache(SV* meta)
+CODE:
+{
+ AV* const xc = mouse_get_xc_if_fresh(aTHX_ meta);
+ if(xc) {
+ SV* const gen = MOUSE_xc_gen(xc);
+ sv_setuv(gen, 0U);
+ }
+ delete_slot(meta, newSVpvs_flags("_mouse_cache_", SVs_TEMP));
+}
+
+
MODULE = Mouse PACKAGE = Mouse::Meta::Role
BOOT: