use warnings;
use Carp qw(confess);
+use Moose::Util;
use Scalar::Util 'blessed';
# introspection
my $self = shift;
my ($other_name) = @_;
- return $self->_get_compatible_metaclass_by_subclassing($other_name);
+ return $self->_get_compatible_metaclass_by_subclassing($other_name)
+ || $self->_get_compatible_metaclass_by_role_reconciliation(@_);
}
sub _get_compatible_metaclass_by_subclassing {
return;
}
+sub _get_compatible_metaclass_by_role_reconciliation {
+ my $self = shift;
+ my ($other_name) = @_;
+ my $meta_name = blessed($self) ? $self->_real_ref_name : $self;
+
+ return unless Moose::Util::_classes_differ_by_roles_only(
+ $meta_name, $other_name
+ );
+
+ return Moose::Util::_reconcile_roles_for_metaclass(
+ $meta_name, $other_name
+ );
+}
+
1;
# ABSTRACT: Base class for metaclasses
use warnings;
use Carp::Heavy;
-use Class::MOP::MiniTrait;
use Moose::Error::Util;
use base 'Class::MOP::Object';
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
sub new {
my ( $self, @args ) = @_;
# can't use Moose::Error::Util::create_error here because that would break
use Moose::Meta::Method::Delegation;
use Moose::Util ();
use Moose::Util::TypeConstraints ();
-use Class::MOP::MiniTrait;
use base 'Class::MOP::Attribute', 'Moose::Meta::Mixin::AttributeCore';
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
__PACKAGE__->meta->add_attribute('traits' => (
reader => 'applied_traits',
predicate => 'has_applied_traits',
use Moose::Meta::Method::Destructor;
use Moose::Meta::Method::Meta;
use Moose::Util;
-use Class::MOP::MiniTrait;
use base 'Class::MOP::Class';
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
__PACKAGE__->meta->add_attribute('roles' => (
reader => 'roles',
default => sub { [] },
use strict;
use warnings;
-use Class::MOP::MiniTrait;
-
use base "Class::MOP::Instance";
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
1;
# ABSTRACT: The Moose Instance metaclass
use strict;
use warnings;
-use Class::MOP::MiniTrait;
-
use base 'Class::MOP::Method';
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
sub _error_thrower {
my $self = shift;
require Moose::Meta::Class;
+++ /dev/null
-
-package Moose::Meta::Object::Trait;
-
-use Scalar::Util qw(blessed);
-
-sub _get_compatible_metaclass {
- my $orig = shift;
- my $self = shift;
- return $self->$orig(@_)
- || $self->_get_compatible_metaclass_by_role_reconciliation(@_);
-}
-
-sub _get_compatible_metaclass_by_role_reconciliation {
- my $self = shift;
- my ($other_name) = @_;
- my $meta_name = blessed($self) ? $self->_real_ref_name : $self;
-
- return unless Moose::Util::_classes_differ_by_roles_only(
- $meta_name, $other_name
- );
-
- return Moose::Util::_reconcile_roles_for_metaclass(
- $meta_name, $other_name
- );
-}
-
-1;
-
-# ABSTRACT: Some overrides for L<Class::MOP::Object> functionality
-
-__END__
-
-=pod
-
-=head1 DESCRIPTION
-
-This module is entirely private, you shouldn't ever need to interact with
-it directly.
-
-=head1 BUGS
-
-See L<Moose/BUGS> for details on reporting bugs.
-
-=cut
use Moose::Meta::Role::Method::Conflicting;
use Moose::Meta::Method::Meta;
use Moose::Util qw( ensure_all_roles );
-use Class::MOP::MiniTrait;
use base 'Class::MOP::Module',
'Class::MOP::Mixin::HasAttributes',
'Class::MOP::Mixin::HasMethods';
-Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
-
## ------------------------------------------------------------------
## NOTE:
## I normally don't do this, but I am doing
use Scalar::Util qw/isweak reftype/;
+use Class::MOP;
use Class::MOP::Instance;
can_ok( "Class::MOP::Instance", $_ ) for qw/
use Test::More;
use Test::Fatal;
+use Class::MOP;
use Class::MOP::Instance;
my $C = 'Class::MOP::Instance';