From d1eb0e3e051f7b1f311aeaaf61e9de4e2fba1b28 Mon Sep 17 00:00:00 2001 From: Damien Krotkine Date: Mon, 3 Jun 2013 02:16:44 +0200 Subject: [PATCH] early hack for Type::Tiny support --- lib/Method/Signatures.pm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/Method/Signatures.pm b/lib/Method/Signatures.pm index 42fcdce..c6b1264 100644 --- a/lib/Method/Signatures.pm +++ b/lib/Method/Signatures.pm @@ -1212,20 +1212,18 @@ our %mutc; # This is a helper function to initialize our %mutc variable. sub _init_mutc { - require Any::Moose; - Any::Moose->import('::Util::TypeConstraints'); + require Type::Registry; + Type::Registry->import(); - no strict 'refs'; - my $class = any_moose('::Util::TypeConstraints'); +# no strict 'refs'; + my $class = 'Type::Registry'; $mutc{class} = $class; - $mutc{findit} = \&{ $class . '::find_or_parse_type_constraint' }; - $mutc{pull} = \&{ $class . '::find_type_constraint' }; - $mutc{make_class} = \&{ $class . '::class_type' }; - $mutc{make_role} = \&{ $class . '::role_type' }; + my $registry = $class->for_me; + $registry->add_types(-Standard); + + $mutc{findit} = sub { $registry->lookup(@_) }; - $mutc{isa_class} = $mutc{pull}->("ClassName"); - $mutc{isa_role} = $mutc{pull}->("RoleName"); } # This is a helper function to find (or create) the constraint we need for a given type. It would