Subject: | ArrayRef for_each doesn't work |
One gets an error like this:
Can't call method "instance" on unblessed reference at /usr/share/perl5/MouseX/NativeTraits/MethodProvider/ArrayRef.pm line 564.
Patch: Use $reader the same way as all the other generate_* subs:
MouseX-NativeTraits-1.09> diff -u lib/MouseX/NativeTraits/MethodProvider/orig.ArrayRef.pm lib/MouseX/NativeTraits/MethodProvider/ArrayRef.pm
--- lib/MouseX/NativeTraits/MethodProvider/orig.ArrayRef.pm 2012-11-26 09:54:42.000000000 +0100
+++ lib/MouseX/NativeTraits/MethodProvider/ArrayRef.pm 2015-01-25 17:12:48.173098438 +0100
@@ -561,7 +561,7 @@
return sub {
my ( $instance, $block ) = @_;
- foreach my $element(@{ $reader->instance($instance) }){
+ foreach my $element(@{ $reader->($instance) }){
$block->($element);
}
return $instance;