Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"once" block doesn't run if it isn't reached the first time the parent block runs #5980

Open
p6rt opened this issue Jan 5, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 5, 2017

Migrated from rt.perl.org#130507 (status was 'new')

Searchable as RT130507$

@p6rt
Copy link
Author

p6rt commented Jan 5, 2017

From @mscha

  for ^10 -> $i {
  once { say "This runs." }
  say $i;
  once { say "This runs as well." }
  next if $i < 5;
  once { say "This should run but doesn't." }
  }

Actual output​:

  This runs.
  0
  This runs as well.
  1
  2
  3
  4
  5
  6
  7
  8
  9

Expected output​:

  This runs.
  0
  This runs as well.
  1
  2
  3
  4
  5
  This should run but doesn't.
  6
  7
  8
  9

Possibly related bug​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=102994

Latest Rakudo Star​:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant