Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Always pass from_namepsace to tc_class if provided.

  • Loading branch information...
commit c60004ae34c4a896273cc24a341c037c8783b33d 1 parent d6a77f7
@ashb ashb authored
Showing with 11 additions and 5 deletions.
  1. +3 −0  Changes
  2. +8 −5 lib/Parse/Method/Signatures.pm
View
3  Changes
@@ -1,5 +1,8 @@
Changelog for Parse::Method::Signatures
+ - Pass from_namespace to type constraint class even if there is a callback
+ provided. (This lets the callback be wrapped/extended better.)
+
1.003011 - 2009/08/18
- Resolve aliased type names when a namespace to look aliases up is given.
View
13 lib/Parse/Method/Signatures.pm
@@ -502,11 +502,14 @@ sub _param_typed {
$tc = $self->type_constraint_class->new(
ppi => $tc,
- $self->has_type_constraint_callback
+ ( $self->has_type_constraint_callback
? (tc_callback => $self->type_constraint_callback)
- : $self->from_namespace
+ : ()
+ ),
+ ( $self->has_from_namespace
? ( from_namespace => $self->from_namespace )
: ()
+ ),
);
$param->{type_constraints} = $tc;
@@ -983,9 +986,9 @@ B<Type:> ClassName
Let this module know which package it is parsing signatures form. This is
entirely optional, and the only effect is has is on parsing type constraints.
-If this attribute is set (and C<type_constraint_callback> is not) it is passed
-to L</type_constraint_class> which can use it to introspect the package
-(commmonly for L<MooseX::Types> exported types). See
+If this attribute is set it is passed to L</type_constraint_class> which can
+use it to introspect the package (commmonly for L<MooseX::Types> exported
+types). See
L<Parse::Method::Signature::TypeConstraints/find_registered_constraint> for
more details.
Please sign in to comment.
Something went wrong with that request. Please try again.