BEGIN {
package TypeLib;
- use MooseX::Types -declare => [qw/MyChar MyDigit ArrayRefOfMyCharOrDigit/];
+ use MooseX::Types -declare => [qw/
+ MyChar MyDigit ArrayRefOfMyCharOrDigit
+ /];
use MooseX::Types::Moose qw/ArrayRef Str Int/;
subtype MyChar, as Str, where {
{
package AClass;
use Moose;
- BEGIN { TypeLib->import(qw/MyChar MyDigit ArrayRefOfMyCharOrDigit/) };
+ BEGIN { TypeLib->import(qw/
+ MyChar MyDigit ArrayRefOfMyCharOrDigit/
+ ) };
use MooseX::Types::Moose 'ArrayRef';
+ local *Moose::Deprecated::deprecated = sub { };
has parameterized => (is => 'rw', isa => ArrayRef[MyChar|MyDigit], coerce => 1);
- has subtype => (is => 'rw', isa => ArrayRefOfMyCharOrDigit, coerce => 1);
+ has subtype_parameterized => (is => 'rw', isa => ArrayRefOfMyCharOrDigit, coerce => 1);
}
my $instance = AClass->new;
+{ local $TODO = "see comments in MooseX::Types->create_arged_...";
lives_ok { $instance->parameterized('foo') }
'coercion applied to parameterized type';
+}
-lives_ok { $instance->subtype('foo') } 'coercion applied to subtype';
+lives_ok { $instance->subtype_parameterized('foo') }
+ 'coercion applied to subtype';