Ticket #1464 (closed bug: invalid)
NQP-rx doesn't handle bare "return" from nested block correctly.
| Reported by: | Austin_Hastings | Owned by: | pmichaud |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | nqp | Version: | 2.1.0 |
| Severity: | medium | Keywords: | |
| Cc: | Language: | ||
| Patch status: | Platform: |
Description
In a nested loop with nested lexicals (requiring a block), a return with no argument does not escape the sub.
austin@andLinux:~/kakapo$ cat test.nqp
sub test1(@items) {
for @items {
my $temp := $_;
if $temp == 2 {
return 0;
}
}
say("Test1 never finishes");
}
sub test2(@items) {
for @items {
my $temp := $_;
if $temp == 2 {
return;
}
}
say("Test2 never finishes");
}
my @items := (1, 2, 3);
test1(@items);
test2(@items);
austin@andLinux:~/kakapo$ parrot-nqp test.nqp
Test2 never finishes
Change History
Note: See
TracTickets for help on using
tickets.
