nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

mro next method not available #301

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

> perlcc -r -e "{ package A; use mro 'c3';  sub foo { 'A::foo' } } { package B; 
use base 'A'; use mro 'c3'; sub foo { (shift)->next::method() } } print 
qq{ok\n} if B->foo eq 'A::foo';"
Can't locate object method "method" via package "next" (perhaps you forgot to 
load "next"?) at -e line 1.

What is the expected output? 

> perl -e "{ package A; use mro 'c3';  sub foo { 'A::foo' } } { package B; use 
base 'A'; use mro 'c3'; sub foo { (shift)->next::method() } } print qq{okif 
B->foo eq 'A::foo';"
ok

Please use labels and text to provide additional information.

Original issue reported on code.google.com by nicolas....@gmail.com on 13 Feb 2014 at 11:50

GoogleCodeExporter commented 9 years ago
mro is not compiled in the binary

Original comment by nicolas....@gmail.com on 13 Feb 2014 at 11:59

GoogleCodeExporter commented 9 years ago
adding a 'require mro' in the main level solves that issue

Original comment by nicolas....@gmail.com on 13 Feb 2014 at 11:59

GoogleCodeExporter commented 9 years ago
In this case the same root cause as #300

Original comment by reini.urban on 14 Feb 2014 at 1:46

GoogleCodeExporter commented 9 years ago
still an issue even after fix for 300

Original comment by nicolas....@gmail.com on 8 May 2014 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by reini.urban on 9 May 2014 at 12:08

GoogleCodeExporter commented 9 years ago
Issue 324 has been merged into this issue.

Original comment by reini.urban on 9 May 2014 at 12:08

GoogleCodeExporter commented 9 years ago
re-opened with updated t/testc.sh commit 
a0056c45c9d773762c6c19b257bf836265294a06
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 19:10:27 2014 -0500

    t/testc.sh: add 301 and 324

Original comment by reini.urban on 9 May 2014 at 12:25

GoogleCodeExporter commented 9 years ago
failure is caused by next::can and next::method from mro not being compiled in. 
Need to special-case it for method_named.

-Dp =>

Considering maybe::next
Delete maybe::next
Considering next
Delete next
Considering next
Cached next is already deleted

Original comment by reini.urban on 9 May 2014 at 12:35

GoogleCodeExporter commented 9 years ago
Fixed with commit 0c51242a8f2ae9743f873c2d13aca3042a6813eb
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 23:47:16 2014 -0500

    C: detect ->next::method (and more)

    check for special next|maybe|NEXT::EVERY methods and include the package
    if used. Fixes issues 301 and 324.
    threaded const->PVs are especially hard to access

Original comment by reini.urban on 9 May 2014 at 11:36