use Scalar::Util qw( blessed reftype );
use Moose::Exporter;
-our $VERSION = '0.73';
+our $VERSION = '0.75_01';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
# these are Class::MOP accessors, so they need inlining
inline_accessors => 1
) for grep { $_->is_mutable }
- map { $_->meta }
+ map { Class::MOP::class_of($_) }
qw(
Moose::Meta::TypeConstraint
Moose::Meta::TypeConstraint::Union
);
type 'Any' => where {1}; # meta-type including all
-type 'Item' => where {1}; # base-type
+subtype 'Item' => as 'Any'; # base-type
subtype 'Undef' => as 'Item' => where { !defined($_) };
subtype 'Defined' => as 'Item' => where { defined($_) };
subtype 'Str' => as 'Value' => where {1} =>
optimize_as \&Moose::Util::TypeConstraints::OptimizedConstraints::Str;
-subtype 'Num' => as 'Value' =>
+subtype 'Num' => as 'Str' =>
where { Scalar::Util::looks_like_number($_) } =>
optimize_as \&Moose::Util::TypeConstraints::OptimizedConstraints::Num;
\&Moose::Util::TypeConstraints::OptimizedConstraints::ClassName;
subtype 'RoleName' => as 'ClassName' => where {
- ( ( $_->can('meta') || return )->($_) || return )
- ->isa('Moose::Meta::Role');
+ (Class::MOP::class_of($_) || return)->isa('Moose::Meta::Role');
} => optimize_as
\&Moose::Util::TypeConstraints::OptimizedConstraints::RoleName;
If passed an ARRAY reference instead of the C<$name>, C<@methods>
pair, this will create an unnamed duck type. This can be used in an
-attribute definiton like so:
+attribute definition like so:
has 'cache' => (
is => 'ro',