Skip to content

Commit

Permalink
Merge branch 'mx_types_introspection'
Browse files Browse the repository at this point in the history
* mx_types_introspection:
  Use MooseX::Types introspection capabilities instead of poking around in the symbol table.
  • Loading branch information
rafl committed Mar 3, 2009
2 parents d86070d + 17f6562 commit e025ee8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ requires 'Parse::Method::Signatures' => '1.002000';
requires 'Devel::Declare' => '0.003004';
requires 'Moose::Util::TypeConstraints';
requires 'Moose';
requires 'MooseX::Types' => '0.09';
requires 'MooseX::Types::Moose';
requires 'MooseX::Types::Structured' => '0.07';
requires 'namespace::clean';
Expand Down
7 changes: 3 additions & 4 deletions lib/MooseX/Method/Signatures/Meta/Method.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Parse::Method::Signatures;
use Scalar::Util qw/weaken/;
use Moose::Util qw/does_role/;
use Moose::Util::TypeConstraints;
use MooseX::Types::Util qw/has_available_type_export/;
use MooseX::Types::Structured qw/Tuple Dict Optional/;
use MooseX::Types::Moose qw/ArrayRef Str Maybe Object Defined CodeRef/;
use aliased 'Parse::Method::Signatures::Param::Named';
Expand Down Expand Up @@ -123,10 +124,8 @@ sub _build__parsed_signature {
input => $self->signature,
type_constraint_callback => sub {
my ($tc, $name) = @_;
my $code = $self->package_name->can($name);
return $code
? eval { $code->() }
: $tc->find_registered_constraint($name);
return has_available_type_export($self->package_name, $name)
|| $tc->find_registered_constraint($name);
},
);
}
Expand Down

0 comments on commit e025ee8

Please sign in to comment.