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.