> On 29 Dec 2015, at 06:59, Julian Snitow (via RT) 
> <perl6-bugs-follo...@perl.org> wrote:
> 
> # New Ticket Created by  Julian Snitow 
> # Please include the string:  [perl #127069]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=127069 >
> 
> 
> This is Rakudo version 2015.12-37-g16c5fc7 built on MoarVM version 2015.12
> implementing Perl 6.c.
> 
> The attached dummy.p6 dies with:
> 
> No lexical found with name '$i'
>  in block <unit> at ./dummy.p6 line 1
> 
> And dummy2.p6 dies with:
> 
> Cannot call infix:«<»(Any, Int); none of these signatures match:
>    ($?)
>    (\a, \b)
>    (Real \a, Real \b)
>    (Int:D \a, Int:D \b)
>    (int $a, int $b)
>    (Num:D \a, Num:D \b --> Bool)
>    (num $a, num $b --> Bool)
>    (Rational:D \a, Rational:D \b)
>    (Rational:D \a, Int:D \b)
>    (Int:D \a, Rational:D \b)
>    (Instant:D $a, Instant:D $b)
>    (DateTime:D \a, DateTime:D \b)
>    (Date:D $a, Date:D $b)
>  in block <unit> at ./dummy2.p6 line 1
> 
> Adding a 0 (or any return value) after the loop but before the
> function close bracket makes the programs work as expected.
> <dummy.p6><dummy2.p6>

FWIW, it seems to be *any* scope based, not just for MAIN:

[13:32:31]  <lizmat>    m: { loop (my int $i = 0; $i < 10; $i++) { say $i } }() 
  # golfed #127069
[13:32:32]  <+camelia>  rakudo-moar 0e89a7: OUTPUT«No lexical found with name 
'$i'␤  in block <unit> at /tmp/Srx2T3Cfj4 line 1␤␤»
[13:33:06]  <lizmat>    m: { loop (my Int $i = 0; $i < 10; $i++) { say $i } }() 
  # golfed #127069
[13:33:07]  <+camelia>  rakudo-moar 0e89a7: OUTPUT«Cannot call infix:«<»(Any, 
Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real 
\b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b --> 
Bool)␤    (num $a, num $b --> Bool)␤    (Rational:D \a…»
[13:33:36]  <lizmat>    m: loop (my Int $i = 0; $i < 10; $i++) { say $i }   # 
ok without the scope
[13:33:37]  <+camelia>  rakudo-moar 0e89a7: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»


Running with MVM_SPESH_DISABLE=1 does not change the problem.



Liz

Reply via email to