Skip Menu |
 

This queue is for tickets about the Data-Visitor CPAN distribution.

Report information
The Basics
Id: 31390
Status: resolved
Priority: 0/
Queue: Data-Visitor

People
Owner: NUFFIN [...] cpan.org
Requestors: tokuhirom [...] gmail.com
Cc:
AdminCc:

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



Subject: Data::Visitor + UNIVERSAL::can = warnings
Download (untitled) / with headers
text/plain 278b
example code: ---- use strict; use warnings; use UNIVERSAL::can; use Data::Visitor::Callback; Data::Visitor::Callback->new( plain_value => sub { } )->visit(1); ---- result: Called UNIVERSAL::can() as a function, not a method at /.../lib//Data/Visitor/Callback.pm line 21
From: NUFFIN [...] cpan.org
Download (untitled) / with headers
text/plain 496b
Very strange, line 21 reads: my @class_callbacks = grep { $_->can("isa") } keys %callbacks; I'll ask chromatic On Tue Dec 11 21:24:21 2007, http://wassr.jp/user/tokuhirom wrote: Show quoted text
> example code: > ---- > use strict; > use warnings; > use UNIVERSAL::can; > use Data::Visitor::Callback; > > Data::Visitor::Callback->new( > plain_value => sub { } > )->visit(1); > ---- > > result: > Called UNIVERSAL::can() as a function, not a method > at /.../lib//Data/Visitor/Callback.pm line 21
RT-Send-CC: chromatic [...] wgz.org
Download (untitled) / with headers
text/plain 230b
Hi chromatic, It looks like UNIVERSAL::can is misdiagnosing this usage as wrong: my @class_callbacks = grep { $_->can("isa") } keys %callbacks; I haven't looked into why yet, and wondered if you might be aware of this issue
From: jrockway [...] cpan.org
Download (untitled) / with headers
text/plain 667b
On Tue Dec 25 18:23:55 2007, NUFFIN wrote: Show quoted text
> Hi chromatic, > > It looks like UNIVERSAL::can is misdiagnosing this usage as wrong: > > my @class_callbacks = grep { $_->can("isa") } keys %callbacks; > > I haven't looked into why yet, and wondered if you might be aware of > this issue
Looks like it warns when a non-loaded package is the invocant: $ perl -MUNIVERSAL::can -Mwarnings -e 'Foo->can("isa")' Called UNIVERSAL::can() as a function, not a method at -e line 1 Compare with: perl -MUNIVERSAL::can -Mwarnings -e 'eval "package Foo"; Foo->can("isa")' Which works fine. Regards, Jonathan Rockway -- Jonathan Rockway <jrockway@cpan.org>
Download (untitled) / with headers
text/plain 514b
OK, since chromatic isn't replying, this is resolved in the repo ( http://nothingmuch.woobling.org/browse_code?r=Data-Visitor ) FSVO resolved (i just disabled warnings in that particular scope). I don't like this "fix" because I think it's a bug in UNIVERSAL::can but honestly I don't care so much, I know my usage is valid in that case and it does work as expected regardless. I'll release a new version soon, I want to add a few other things to D::V first though... Should be up in a few days tops. Cheers


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.