From: Vincent Pit Date: Wed, 15 Jul 2009 13:20:08 +0000 (+0200) Subject: Document and test constant folding X-Git-Tag: rt47902~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=feceaa694dff65ca67ac26a13b67e2c0f8bbb795 Document and test constant folding --- diff --git a/lib/indirect.pm b/lib/indirect.pm index 734896a..6e99eba 100644 --- a/lib/indirect.pm +++ b/lib/indirect.pm @@ -162,6 +162,9 @@ C (no semicolon) at the end of a file won't be seen as an indirect ob With 5.8 perls, the pragma does not propagate into C. This is due to a shortcoming in the way perl handles the hints hash, which is addressed in perl 5.10. +The search for indirect method calls happens before constant folding. +Hence C will be caught. + =head1 DEPENDENCIES L 5.8. diff --git a/t/21-bad.t b/t/21-bad.t index 63516f5..11da77d 100644 --- a/t/21-bad.t +++ b/t/21-bad.t @@ -11,8 +11,8 @@ use warnings; my ($tests, $reports); BEGIN { - $tests = 60; - $reports = 68; + $tests = 61; + $reports = 69; } use Test::More tests => 3 * (4 * $tests + $reports) + 2; @@ -129,6 +129,10 @@ $obj = new Hlagh; ---- [ 'new', 'Hlagh' ] #### +$obj = new Hlagh if 0; +---- +[ 'new', 'Hlagh' ] +#### $obj = new Hlagh(); ---- [ 'new', 'Hlagh' ]