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

Explicit return prevens Failure explosion in sinkage #5698

Open
p6rt opened this issue Sep 27, 2016 · 2 comments
Open

Explicit return prevens Failure explosion in sinkage #5698

p6rt opened this issue Sep 27, 2016 · 2 comments

Comments

@p6rt
Copy link

p6rt commented Sep 27, 2016

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

Searchable as RT129373$

@p6rt
Copy link
Author

p6rt commented Sep 27, 2016

From @zoffixznet

Unsure if this is on purpose or not​:

If I have a variable with a Failure in it and I let it be the last statement of a sub, so it's returned, and I call the sub and let its return sink, the failure explodes​:

$ perl6 -e 'sub wone { fail }; sub two { my $x = wone; $x }(); say "all good"'
Failed
  in sub wone at -e line 1
  in sub two at -e line 1
  in block <unit> at -e line 1

Actually thrown at​:
  in block <unit> at -e line 1

BUT, if I use an explicit `return`, the explosion no longer happens​:

$ perl6 -e 'sub wone { fail }; sub two { my $x = wone; return $x }(); say "all good"'
all good

@p6rt
Copy link
Author

p6rt commented Jan 3, 2018

From @zoffixznet

Related Issue​: rakudo/rakudo#1360

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