$>perl -e 'package Alice; sub sing; package main; $c = bless {}, 'Alice'; print
"ok\n" if $c->can("sing")'
ok
$>perlcc -r -e 'package Alice; sub sing; package main; $c = bless {}, 'Alice';
print "ok\n" if $c->can("sing")'
So the problem I assume is that B::C can't or chooses not to report that Alice
has a prototyped subroutine. This might trip up autoload among other things?
NOTE: If this gets fixed, let's make sure this one passes the same as perl too:
$>perlcc -r -e 'package Girl; sub sing; package Alice; @ISA = ("Girl"); package
main; $c = bless {}, 'Alice'; print "ok\n" if $c->can("sing"); $c->sing()'
Can't locate object method "sing" via package "Alice" at -e line 1.
$>perl -e 'package Girl; sub sing; package Alice; @ISA = ("Girl"); package
main; $c = bless {}, 'Alice'; print "ok\n" if $c->can("sing"); $c->sing()'
ok
Undefined subroutine &Girl::sing called at -e line 1.
Note that perl seems to know what subroutine it should have called in the
inheritance path, regardles of whether sing is defined.
Original issue reported on code.google.com by todd.e.rinaldo on 23 Jan 2014 at 10:36
Original issue reported on code.google.com by
todd.e.rinaldo
on 23 Jan 2014 at 10:36