6 use Test::More tests => 4;
9 my $buf = (caller(0))[2];
10 open $_[1], '<', \$buf;
19 is $r, __LINE__-2, 'trick for our - readline';
23 is $s, __LINE__-2, 'trick for my - readline';
26 is $z, 7, 'trick for others';
31 sub Int::TYPEDSCALAR { push @lines, (caller(0))[2]; () }
34 use Lexical::Types as => sub {
35 # In 5.10, this closure is compiled before hints are enabled, so no hintseval
36 # op is added at compile time to propagate the hints inside the eval.
37 # That's why we need to re-use Lexical::Types explicitely.
38 eval 'use Lexical::Types; my Int $x';
43 is_deeply \@lines, [ 1, __LINE__-1 ], 'hooking inside the \'as\' callback';