From: Jesse Luehrs Date: Tue, 19 Oct 2010 04:58:23 +0000 (-0500) Subject: complicated expressions can't be dereferenced directly X-Git-Tag: 1.17~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d06edbfadf08687599bd8c8fd711f8c14cc2363;p=gitmo%2FMoose.git complicated expressions can't be dereferenced directly Ambiguous use of @{do{...}} resolved to @do{...} --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm index 0e5d60b..cd6aa03 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm @@ -18,7 +18,7 @@ sub _new_members {'@_'} sub _inline_copy_old_value { my ( $self, $slot_access ) = @_; - return '[ @{' . $slot_access . '} ]'; + return '[ @{(' . $slot_access . ')} ]'; } 1; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/count.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/count.pm index 4e2e479..89e6dd9 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/count.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/count.pm @@ -17,7 +17,7 @@ sub _maximum_arguments { 0 } sub _return_value { my ( $self, $slot_access ) = @_; - return "scalar \@{ $slot_access }"; + return "scalar \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm index aee35dd..5697b8a 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm @@ -37,13 +37,13 @@ sub _potential_value { my ( $self, $slot_access ) = @_; return - "( do { my \@potential = \@{ $slot_access }; \@return = splice \@potential, \$_[0], 1; \\\@potential } )"; + "( do { my \@potential = \@{ ($slot_access) }; \@return = splice \@potential, \$_[0], 1; \\\@potential } )"; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "\@return = splice \@{ $slot_access }, \$_[0], 1"; + return "\@return = splice \@{ ($slot_access) }, \$_[0], 1"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm index 847449c..437ea36 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm @@ -18,7 +18,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "\@{ $slot_access }"; + return "\@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm index 80b7be4..d9a9990 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm @@ -38,7 +38,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "&List::Util::first( \$_[0], \@{ ${slot_access} } )"; + return "&List::Util::first( \$_[0], \@{ ($slot_access) } )"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm index cf441d1..d7a209d 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm @@ -37,7 +37,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "grep { \$_[0]->() } \@{ $slot_access }"; + return "grep { \$_[0]->() } \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm index 1afdb8c..e93985f 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm @@ -31,7 +31,7 @@ sub _potential_value { my ( $self, $slot_access ) = @_; return - "( do { my \@potential = \@{ $slot_access }; splice \@potential, \$_[0], 0, \$_[1]; \\\@potential } )"; + "( do { my \@potential = \@{ ($slot_access) }; splice \@potential, \$_[0], 0, \$_[1]; \\\@potential } )"; } sub _new_members { '$_[1]' } @@ -39,7 +39,7 @@ sub _new_members { '$_[1]' } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "splice \@{ $slot_access }, \$_[0], 0, \$_[1];"; + return "splice \@{ ($slot_access) }, \$_[0], 0, \$_[1];"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm index fe90c00..254640d 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm @@ -18,7 +18,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "\@{ $slot_access } ? 0 : 1"; + return "\@{ ($slot_access) } ? 0 : 1"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/join.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/join.pm index 04c1209..1be84e3 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/join.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/join.pm @@ -37,7 +37,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "join \$_[0], \@{ $slot_access }"; + return "join \$_[0], \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/map.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/map.pm index 0082136..889ea14 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/map.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/map.pm @@ -37,7 +37,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "map { \$_[0]->() } \@{ $slot_access }"; + return "map { \$_[0]->() } \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm index 63d0be7..17ed1bc 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm @@ -42,7 +42,7 @@ sub _inline_return_value { my ( $self, $slot_access ) = @_; return - "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ $slot_access } );" + "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ ($slot_access) } );" . "\n" . 'if ( $_[1] ) {' . "\n" . 'while (my @vals = $iter->()) {' . "\n" diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm index f270ec2..9e371b3 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm @@ -25,7 +25,7 @@ sub _adds_members { 0 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "[ \@{ $slot_access } > 1 ? \@{ $slot_access }[ 0 .. \$#{ $slot_access } - 1 ] : () ]"; + return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 0 .. \$#{ ($slot_access) } - 1 ] : () ]"; } sub _inline_capture_return_value { @@ -37,7 +37,7 @@ sub _inline_capture_return_value { sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "pop \@{ $slot_access }"; + return "pop \@{ ($slot_access) }"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm index 48995b7..ce6a11a 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm @@ -23,19 +23,19 @@ sub _adds_members { 1 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "[ \@{ $slot_access }, \@_ ]"; + return "[ \@{ ($slot_access) }, \@_ ]"; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "push \@{ $slot_access }, \@_"; + return "push \@{ ($slot_access) }, \@_"; } sub _return_value { my ( $self, $slot_access ) = @_; - return "return scalar \@{ $slot_access }"; + return "return scalar \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm index 8c61f93..9176db6 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm @@ -38,7 +38,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "List::Util::reduce { \$_[0]->( \$a, \$b ) } \@{ ${slot_access} }"; + return "List::Util::reduce { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/set.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/set.pm index d4129cf..4d8b6df 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/set.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/set.pm @@ -38,7 +38,7 @@ sub _potential_value { my ( $self, $slot_access ) = @_; return - "( do { my \@potential = \@{ $slot_access }; \$potential[ \$_[0] ] = \$_[1]; \\\@potential } )"; + "( do { my \@potential = \@{ ($slot_access) }; \$potential[ \$_[0] ] = \$_[1]; \\\@potential } )"; } sub _new_members { '$_[1]' } diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm index bdd10f6..8d3e7ff 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm @@ -27,7 +27,7 @@ sub _adds_members { 0 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "[ \@{ $slot_access } > 1 ? \@{ $slot_access }[ 1 .. \$#{ $slot_access } ] : () ]"; + return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 1 .. \$#{ ($slot_access) } ] : () ]"; } sub _inline_capture_return_value { @@ -39,7 +39,7 @@ sub _inline_capture_return_value { sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "shift \@{ $slot_access };"; + return "shift \@{ ($slot_access) };"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm index bddbd95..1b193a9 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "List::Util::shuffle \@{ $slot_access }"; + return "List::Util::shuffle \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm index c3c5a13..99239ca 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm @@ -35,7 +35,7 @@ sub _return_value { my $slot_access = shift; return - "\$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ${slot_access} } : sort \@{ $slot_access }"; + "\$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) } : sort \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm index c412c13..7942334 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm @@ -37,7 +37,7 @@ sub _potential_value { my ( $self, $slot_access ) = @_; return - "[ \$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ $slot_access } : sort \@{ $slot_access} ]"; + "[ \$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) } : sort \@{ ($slot_access) } ]"; } sub _return_value { return q{} } diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm index 09fbcbe..e97836b 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm @@ -41,14 +41,14 @@ sub _inline_check_arguments { sub _potential_value { my ( $self, $slot_access ) = @_; - return "( do { my \@potential = \@{ $slot_access };" + return "( do { my \@potential = \@{ ($slot_access) };" . '@return = defined $len ? ( splice @potential, $idx, $len, @_ ) : ( splice @potential, $idx ); \\@potential } )'; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "\@return = defined \$len ? ( splice \@{ $slot_access }, \$idx, \$len, \@_ ) : ( splice \@{ $slot_access }, \$idx )"; + return "\@return = defined \$len ? ( splice \@{ ($slot_access) }, \$idx, \$len, \@_ ) : ( splice \@{ ($slot_access) }, \$idx )"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm index c8522e0..f87f1f3 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "List::MoreUtils::uniq \@{ $slot_access }"; + return "List::MoreUtils::uniq \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm index d0d9881..6313cdb 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm @@ -23,19 +23,19 @@ sub _adds_members { 1 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "[ \@_, \@{ $slot_access } ]"; + return "[ \@_, \@{ ($slot_access) } ]"; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "unshift \@{ $slot_access }, \@_"; + return "unshift \@{ ($slot_access) }, \@_"; } sub _return_value { my ( $self, $slot_access ) = @_; - return "return scalar \@{ $slot_access }"; + return "return scalar \@{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm index ea39c58..7e06103 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm @@ -20,7 +20,7 @@ sub _new_values {'@values'} sub _inline_copy_old_value { my ( $self, $slot_access ) = @_; - return '{ %{' . $slot_access . '} }'; + return '{ %{(' . $slot_access . ')} }'; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm index 5057e21..fe0f7a6 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "scalar keys \%{ $slot_access }"; + return "scalar keys \%{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm index 54af8f5..e7cf85d 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm @@ -23,13 +23,13 @@ sub _adds_members { 0 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "( do { my \%potential = %{ $slot_access }; \@return = delete \@potential{\@_}; \\\%potential; } )"; + return "( do { my \%potential = %{ ($slot_access) }; \@return = delete \@potential{\@_}; \\\%potential; } )"; } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "\@return = delete \@{ $slot_access }{\@_}"; + return "\@return = delete \@{ ($slot_access) }{\@_}"; } sub _return_value { diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm index bf25766..6e8f105 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "map { \$_, ${slot_access}->{\$_} } keys \%{ $slot_access }"; + return "map { \$_, ${slot_access}->{\$_} } keys \%{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm index dbde3d5..a4b2e1e 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm @@ -35,7 +35,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "\@_ > 1 ? \@{ $slot_access }{\@_} : ${slot_access}->{ \$_[0] }"; + return "\@_ > 1 ? \@{ ($slot_access) }{\@_} : ${slot_access}->{ \$_[0] }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm index 8f886b6..2de1604 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "scalar keys \%{ $slot_access } ? 0 : 1"; + return "scalar keys \%{ ($slot_access) } ? 0 : 1"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm index f6ad9c9..22855e2 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "keys \%{ $slot_access }"; + return "keys \%{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm index 06ad6fa..ad99400 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "map { [ \$_, ${slot_access}->{\$_} ] } keys \%{ $slot_access }"; + return "map { [ \$_, ${slot_access}->{\$_} ] } keys \%{ ($slot_access) }"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm index 62850ca..1bb37cd 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm @@ -61,7 +61,7 @@ sub _adds_members { 1 } sub _potential_value { my ( $self, $slot_access ) = @_; - return "{ %{ $slot_access }, \@_ }"; + return "{ %{ ($slot_access) }, \@_ }"; } sub _new_members { '@_[ @values_idx ]' } @@ -69,13 +69,13 @@ sub _new_members { '@_[ @values_idx ]' } sub _inline_optimized_set_new_value { my ( $self, $inv, $new, $slot_access ) = @_; - return "\@{ $slot_access }{ \@_[ \@keys_idx] } = \@_[ \@values_idx ]"; + return "\@{ ($slot_access) }{ \@_[ \@keys_idx] } = \@_[ \@values_idx ]"; } sub _return_value { my ( $self, $slot_access ) = @_; - return "return wantarray ? \@{ $slot_access }{ \@_[ \@keys_idx ] } : ${slot_access}->{ \$_[ \$keys_idx[0] ] };"; + return "return wantarray ? \@{ ($slot_access) }{ \@_[ \@keys_idx ] } : ${slot_access}->{ \$_[ \$keys_idx[0] ] };"; } no Moose::Role; diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm index 79c6980..2845cae 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm @@ -20,7 +20,7 @@ sub _return_value { my $self = shift; my $slot_access = shift; - return "values \%{ $slot_access }"; + return "values \%{ ($slot_access) }"; } no Moose::Role;