nayakgi / perl-compiler

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

mro maybe::next::method #326

Closed GoogleCodeExporter closed 9 years ago

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

> perlcc -r -e 'package Diamond_C; sub maybe { "Diamond_C::maybe" } package 
Diamond_D; use base "Diamond_C"; use mro "c3"; sub maybe { "Diamond_D::maybe => 
" . ((shift)->maybe::next::method() || 0) } package main; print "ok\n" if 
Diamond_D->maybe;'
Can't locate object method "method" via package "maybe::next" (perhaps you 
forgot to load "maybe::next"?) at -e line 1.

What is the expected output? What do you see instead?

> perl -e 'package Diamond_C; sub maybe { "Diamond_C::maybe" } package 
Diamond_D; use base "Diamond_C"; use mro "c3"; sub maybe { "Diamond_D::maybe => 
" . ((shift)->maybe::next::method() || 0) } package main; print "ok\n" if 
Diamond_D->maybe;'
ok

Please use labels and text to provide additional information.

Original issue reported on code.google.com by nicolas....@gmail.com on 9 May 2014 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by todd.e.rinaldo on 9 May 2014 at 8:10

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Why high? I never heard of anyone using maybe::next::method

https://code.google.com/p/chromium/codesearch#search/&q=maybe::next::method%20la
ng:%5Eperl$&sq=package:chromium&type=cs
=> Your search - maybe::next::method lang:^perl$ - did not match any documents
only next::method is used heavily

Original comment by reini.urban on 11 May 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by reini.urban on 14 May 2014 at 2:51

GoogleCodeExporter commented 9 years ago
Need to check this also:
7                  <1> entersub[t1] sKS/TARG ->8
3                    <0> pushmark s ->4
4                    <0> shift sPM* ->5
6                    <1> method sK/1 ->7
5                       <$> const(PV "maybe::next::method") s/BARE ->6

Original comment by reini.urban on 21 May 2014 at 9:32

GoogleCodeExporter commented 9 years ago
Fixed in master 1.46_01 with commit e82b55429aa0d17bbcdcb52c92289fcea8725105
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed May 21 16:42:32 2014 -0500

    C: detect maybe::next::method

    fixes issue 326.
    Note that there is no maybe::next equivalent in 5.8, so we just use a NEXT::DISTINCT method

Original comment by reini.urban on 21 May 2014 at 10:14

GoogleCodeExporter commented 9 years ago
This issue was closed by revision e82b55429aa0.

Original comment by reini.urban on 29 May 2014 at 12:19