use Carp 'confess';
use Scalar::Util 'weaken', 'blessed', 'reftype';
-our $VERSION = '0.14';
+our $VERSION = '0.15';
our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Method::Overriden;
my $gv = B::svref_2object($code)->GV;
my $pkg = $gv->STASH->NAME;
- if ($pkg->can('meta') && $pkg->meta && $pkg->meta->isa('Moose::Meta::Role')) {
+ if ($pkg->can('meta')
+ # NOTE:
+ # we don't know what ->meta we are calling
+ # here, so we need to be careful cause it
+ # just might blow up at us, or just complain
+ # loudly (in the case of Curses.pm) so we
+ # just be a little overly cautious here.
+ # - SL
+ && eval { no warnings; blessed($pkg->meta) }
+ && $pkg->meta->isa('Moose::Meta::Role')) {
#my $role = $pkg->meta->name;
#next unless $self->does_role($role);
}
sub _get_type_constraint_registry { $REGISTRY }
sub _dump_type_constraints { $REGISTRY->dump }
+# NOTE:
+# this method breaks down the sugar
+# from the functions below.
sub _create_type_constraint ($$$;$$) {
my $name = shift;
my $parent = shift;
}
$parent = $REGISTRY->get_type_constraint($parent) if defined $parent;
+
my $constraint = Moose::Meta::TypeConstraint->new(
name => $name || '__ANON__',
parent => $parent,