On Sun Sep 13 06:33:12 2009, Tim.Bunce@pobox.com wrote:
Show quoted text> On Sat, Sep 12, 2009 at 06:55:55PM -0400, DROLSKY via RT wrote:
> > > Can't locate object method "schema" via package
> > > "TigerLead::Schema::PPC_YSM" at
> > > /home/tim/trunk/perl/cpan/lib/perl5/Moose/Meta/Method/Delegation.pm
> > > line 91
> > >
> > > doesn't indicate the file and line number of the method call itself.
> > > The name of the attribute handling the delegation would also be handy.
> >
> > I think to do something intelligent here we'd have to call
> > $object->attr->can('method') before actually calling the delegation
> > method, _every time_.
> >
> > Is the speed hit worth it? I don't know (haven't benchmarked either).
>
> Umm. Or perhaps wrap in an eval { } and check for /^Can't locate object
> method "$method"/ and add in the extra info only if that matches.
> Eval { } is very cheap.
I was just looking at this again.
While eval is a reasonable suggestion, some code also acts differently under eval, which is a problem since we really want to make sure delegation acts as identically to $self->delegate->method as possible.