--- /dev/null
+- We need a Role for Moose::Meta::TypeConstraint to define the interface we are decorating
+- we need a Role or some way to detect when there are parameters attached to the type
+
+??Do we need some sort of Factory for controlling the creation of types?
+
+Moose::TypeConstraint->create_base(%opt);
+Moose::TypeConstraint->create_structured(%opt, %signature_opts);
+Moose::TypeConstraint->create_parameterized(%opt, %);
+
+then a ...->create(%opt) that chooses one of the above????
+
+
my ($class, $type, $full) = @_;
return sub {
my @args = @_;
- use Data::Dump qw/dump/; warn @args;
+ use Data::Dump qw/dump/; warn dump @args if @args;
my $type_constraint = find_type_constraint($full)
|| MooseX::Types::UndefinedType->new($full);
+
+ if(@args) {
+ my $tc = $args[0]->[0];
+ warn dump $tc;
+ $type_constraint->type_constraint($tc);
+ }
return MooseX::Types::TypeDecorator->new(type_constraint=>$type_constraint);
};
}
--- /dev/null
+#!/usr/bin/env perl
+use warnings;
+use strict;
+
+use Test::More tests => 1;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use DecoratorLibrary qw( ArrayOfInts);
+
+is 1,1, 'ok';
+
+use Data::Dump qw/dump/;