});
$meta->superclasses($base_class)
- unless $class->isa($base_class);
+ unless $meta->superclasses;
# make a class type for each Mouse class
Mouse::Util::TypeConstraints::class_type($class)
sub method_metaclass() { 'Mouse::Meta::Method' }
sub attribute_metaclass() { 'Mouse::Meta::Attribute' }
-sub constructor_class() { 'Mouse::Meta::Method::Constructor' }
+sub constructor_class(); # XS
sub destructor_class() { 'Mouse::Meta::Method::Destructor' }
sub _construct_meta {
sub make_immutable {
my $self = shift;
my %args = (
- inline_constructor => 0,
+ inline_constructor => 1,
inline_destructor => 1,
constructor_name => 'new',
@_,
package
Mouse::Meta::Class;
+sub constructor_class() { 'Mouse::Meta::Method::Constructor' }
sub is_anon_class{
return exists $_[0]->{anon_serial_id};
use Mouse;
sub foo { }
no Mouse;
- __PACKAGE__->meta->make_immutable(inline_constructor => 1);
+ __PACKAGE__->meta->make_immutable();
}
{
package MouseRole;
BOOT:
INSTALL_SIMPLE_READER(Class, roles);
INSTALL_SIMPLE_PREDICATE_WITH_KEY(Class, is_anon_class, anon_serial_id);
+ newCONSTSUB(gv_stashpvs("Mouse::Meta::Class", TRUE), "constructor_class",
+ newSVpvs("Mouse::Meta::Method::Constructor::XS"));
void
linearized_isa(SV* self)
}
OUTPUT:
RETVAL
+
+MODULE = Mouse PACKAGE = Mouse::Meta::Method::Constructor::XS
+
+CV*
+_generate_constructor(...)
+CODE:
+{
+ RETVAL = get_cvs("Mouse::Object::new", TRUE);
+ SvREFCNT_inc_simple_void_NN(RETVAL);
+}
+OUTPUT:
+ RETVAL
+