Permalink
Browse files

Implement scalar placeholder values.

  • Loading branch information...
1 parent c1e4a6b commit a522420927c84d23e1a8d353254f0bf7f002611b @rafl committed Mar 3, 2009
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/MooseX/Method/Signatures/Meta/Method.pm
@@ -9,6 +9,7 @@ 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';
+use aliased 'Parse::Method::Signatures::Param::Placeholder';
use namespace::clean -except => 'meta';
@@ -172,13 +173,12 @@ sub _build__lexicals {
? $sig->invocant->variable_name
: '$self';
- if ($sig->has_positional_params) {
- push @lexicals, $_->variable_name for $sig->positional_params;
- }
-
- if ($sig->has_named_params) {
- push @lexicals, $_->variable_name for $sig->named_params;
- }
+ push @lexicals,
+ (does_role($_, Placeholder)
+ ? 'undef'
+ : $_->variable_name)
+ for (($sig->has_positional_params ? $sig->positional_params : ()),
+ ($sig->has_named_params ? $sig->named_params : ()));
return \@lexicals;
}

0 comments on commit a522420

Please sign in to comment.