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

LAST is called when it shouldn't be (my $x = do while (1) { LAST { die ‘hello’ }; }) #6018

Open
p6rt opened this issue Jan 20, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Jan 20, 2017

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

Searchable as RT130600$

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @AlexDaniel

First of all, consider this snippet​:

Code​:
my $x = do while (1) { 42 }; say $x[^10]

Result​:
(42 42 42 42 42 42 42 42 42 42)

And now look at this​:

Code​:
my $x = do while (1) { LAST { say �hello� }; }

Result​:
hello

And this​:

Code​:
my $x = do while (1) { LAST { say �hello� } }; say $x[^10]

Result​:
hello
No such method '!capture_phasers' for invocant of type 'Code'
  in block <unit> at /tmp/mmzjeI1jE1 line 1

Does not look quite right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant