Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 89397
Status: open
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: 0body0 [...] rambler.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Is this bug or feature?
Date: Thu, 10 Oct 2013 22:54:02 +0400
To: bug-moose [...] rt.cpan.org
From: Анатолий Гришаев <0body0 [...] rambler.ru>
Having this code ====================== package A; use Moose; sub run{ my $self = shift; inner(); $self->cleanup; } sub cleanup{ inner(); say STDERR "cleanup"; } package B; use Moose; extends 'A'; augment run => sub { my $self = shift; say STDERR "B is running"; }; my $x = B->new->run(); ======================== I expect the script outputs something like this: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx B is running cleanup xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx But the script produce following: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx B is running B is running cleanup xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Look like a bug for me, but I am not sure. Best regards, Anatoliy Grishaev.
This appears to be a bug - and an interesting one -- cleanup's inner() is definitely invoking B::run, when instead it should be a no-op. As a workaround for now, I would suggest writing an empty B::cleanup 'augment', so A::cleanup's inner has something correct it can call.