package_defined_in => __PACKAGE__,
parent => find_type_constraint('Ref'),
constraint => sub { ref($_) eq 'SCALAR' || ref($_) eq 'REF' },
- optimized =>
- \&Moose::Util::TypeConstraints::OptimizedConstraints::ScalarRef,
+ inline_optimized =>
+ Moose::Util::TypeConstraints::OptimizedConstraints::InlineScalarRef,
constraint_generator => sub {
my $type_parameter = shift;
my $check = $type_parameter->_compiled_type_constraint;
package_defined_in => __PACKAGE__,
parent => find_type_constraint('Ref'),
constraint => sub { ref($_) eq 'ARRAY' },
- optimized =>
- \&Moose::Util::TypeConstraints::OptimizedConstraints::ArrayRef,
+ inline_optimized =>
+ Moose::Util::TypeConstraints::OptimizedConstraints::InlineArrayRef,
constraint_generator => sub {
my $type_parameter = shift;
my $check = $type_parameter->_compiled_type_constraint;
package_defined_in => __PACKAGE__,
parent => find_type_constraint('Ref'),
constraint => sub { ref($_) eq 'HASH' },
- optimized =>
- \&Moose::Util::TypeConstraints::OptimizedConstraints::HashRef,
+ inline_optimized =>
+ Moose::Util::TypeConstraints::OptimizedConstraints::InlineHashRef,
constraint_generator => sub {
my $type_parameter = shift;
my $check = $type_parameter->_compiled_type_constraint;
package_defined_in => __PACKAGE__,
parent => find_type_constraint('Item'),
constraint => sub {1},
+ inline_optimized => '1',
constraint_generator => sub {
my $type_parameter = shift;
my $check = $type_parameter->_compiled_type_constraint;
q{defined($_[0]) && !ref($_[0]) && $_[0] =~ /^-?[0-9]+$/}
}
-# XXX: not used yet
sub InlineScalarRef { q{ref($_[0]) eq 'SCALAR' || ref($_[0]) eq 'REF'} }
sub InlineArrayRef { q{ref($_[0]) eq 'ARRAY'} }
sub InlineHashRef { q{ref($_[0]) eq 'HASH'} }
sub InlineRegexpRef { q{ref($_[0]) eq 'Regexp'} }
sub InlineGlobRef { q{ref($_[0]) eq 'GLOB'} }
-sub ScalarRef { ref($_[0]) eq 'SCALAR' || ref($_[0]) eq 'REF' }
-sub ArrayRef { ref($_[0]) eq 'ARRAY' }
-sub HashRef { ref($_[0]) eq 'HASH' }
-sub CodeRef { ref($_[0]) eq 'CODE' }
-sub RegexpRef { ref($_[0]) eq 'Regexp' }
-sub GlobRef { ref($_[0]) eq 'GLOB' }
-
sub InlineFileHandle {
q{(ref($_[0]) eq 'GLOB' && Scalar::Util::openhandle($_[0]))}
. q{ or (Scalar::Util::blessed($_[0]) && $_[0]->isa('IO::Handle'))}