develooper Front page | perl.perl5.porters | Postings from June 2015

[perl #125461] mro next::method doesn't work from imported method

From:
Olivier Mengué
Date:
June 23, 2015 12:29
Subject:
[perl #125461] mro next::method doesn't work from imported method
Message ID:
rt-4.0.18-26017-1435062551-1992.125461-75-0@perl.org
# New Ticket Created by  Olivier Mengué 
# Please include the string:  [perl #125461]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125461 >


Hi,

I would like to use next::method from a method implemented in a role and injected in a class by aliasing methods.
But it seems next::method doesn't work in that case: it doesn't find the super method.

See the attached code for a self contained minimal test case.

Here is the (failing) output:

------8<------8<------8<------8<------8<------8<------8<------
$ perl next_method.pl 
1..1
# perl v5.22.0
Hi2 from Child!
Hi2 from Parent!
Hi2 from Child!
Hi2 from Parent!
Hi from Role!
not ok 1
#   Failed test at next_method.pl line 69.
#          got: 'No next::method 'hello' found for Child at /home/omengue/.plenv/versions/5.22.0/lib/perl5/5.22.0/x86_64-linux/mro.pm line 27.
# '
#     expected: undef
# Looks like you failed 1 test of 1.
------8<------8<------8<------8<------8<------8<------8<------

--
Olivier Mengué <dolmen@cpan.org>


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About