Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: s.zuban [...] gmail.com
perl [...] toby.ink
ZDM [...] cpan.org
Cc:
AdminCc:

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



use 5.010; { package C1; use Moose; sub foo { join '||', 'C1::foo', inner(), shift->bar } sub bar { 'C1::bar' . (inner() // '') } } { package C2; use Moose; extends qw(C1); augment foo => sub { 'C2::foo' } } say C2->new->foo; ########################################################### Expected result: C1::foo||C2::foo||C1::bar Actual result: C1::foo||C2::foo||C1::barC2::foo Explanation: inner() inside C1::bar should be a no-op, as C2 does not augment bar. However, inner() climbs the callstack too far and finds the augmented method foo.
Subject: Unexpected inner behaviour
Hi. I have two classes: #---------------------------------- package BB; use 5.18.1; use Moose; sub run { my $self = shift; say 1; $self->build; say 4; return inner(); } sub build { my $self = shift; say 2; return inner(); } 1; __END__ #---------------------------------- package AA; use 5.18.1; use Moose; extends qw(BB); augment run => sub { my $self = shift; say 5; return inner(); }; 1; __END__ #---------------------------------- When i make call AA->new->run i expect that output will be: 1 2 4 5 but receive: 1 2 5 4 5 this mean that method BB::build inner() call AA::run. This is unexpected, because, AA::run is augment BB::run, not BB::build. Is it a bug or feature?
Subject: Re: [rt.cpan.org #91504] Unexpected inner behaviour
Date: Wed, 18 Dec 2013 16:58:13 -0800
To: Dmytro Zagashev via RT <bug-Moose [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Wed, Dec 18, 2013 at 05:04:39PM -0500, Dmytro Zagashev via RT wrote: Show quoted text
> Is it a bug or feature?
It's a bug -- the same one as https://rt.cpan.org/Ticket/Display.html?id=73850 actually :)
Subject: nested inner() calls wrong modifier
Date: Mon, 21 Mar 2016 17:07:14 -0500
To: bug-moose [...] rt.cpan.org
From: Sergiy Zuban <s.zuban [...] gmail.com>
inner() call in Foo::make() actually calls "run" from Foo::Bar, but should should do nothing because it's not augmented. local vars $Moose::INNER_ARGS and $Moose::INNER_BODY doesn't seem to be properly reset for nested inner() calls. --------- package Foo { use Moose; sub make { warn 'make'; inner(); # BUG: calls augmented "run" instead of doing nothing } sub run { my $self = shift; warn 'run'; inner(); $self->make; } __PACKAGE__->meta->make_immutable; } package Foo::Bar { use Moose; extends 'Foo'; augment run => sub { warn 'augmented run'; }; # augment make => sub # { # warn 'augmented make'; # }; __PACKAGE__->meta->make_immutable; } my $foo = Foo::Bar->new; $foo->run; -- Sergiy Zuban
Looks like the same bug as https://rt.cpan.org/Ticket/Display.html?id=73850 I think this is just waiting for a PR. I don't think most people who regularly hack on Moose use this feature, so it's not been a priority (at least not for me).