Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 109632
Status: resolved
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: VDB [...] cpan.org
Cc:
AdminCc:

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



Subject: Delegation and Carping produces confusing results.
Please see bug #109631 submitted against Moose. Moo has the same problem: ---------- $ cat moo-carping.pl #!/usr/bin/perl { package BB; use Moo; use Carp; sub method { my ( $self ) = @_; Carp::croak "AAA"; }; } { package AA; use Moo; has b => ( is => 'ro', handles => [ 'method' ], builder => '_build_b', ); sub _build_b { return BB->new(); }; } my $a = AA->new(); $a->method(); $ perl ./moo-carping.pl AAA at (eval 11) line 17. ---------- Such error location "(eval 11) line 17" is very confusing, especially for a newbie. In case of Moose simple trick helps to fix the problem: $Carp::Internal{ 'Moose::Meta::Method::Delegation' } = 1; Unfortunately, I failed to make this work with Moo. Neither $Carp::Internal{ 'Moo' } = 1; nor $Carp::Internal{ 'Sub::Defer' } = 1; helps. I am not familiar with Moo (and Moose) internals, probably you know the module to declare "internal" for Carp?
This is fixed in git.
Fixed in 2.002002.