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

try {} without CATCH not catching an exception #4197

Closed
p6rt opened this issue May 5, 2015 · 4 comments
Closed

try {} without CATCH not catching an exception #4197

p6rt opened this issue May 5, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 5, 2015

Migrated from rt.perl.org#125109 (status was 'resolved')

Searchable as RT125109$

@p6rt
Copy link
Author

p6rt commented May 5, 2015

From @raydiak

See http://irclog.perlgeek.de/perl6/2015-05-05#i_10552113

Besides the obvious problem (.clone should work there), in the process of examining it I encountered another oddity​: trapping it with a try block doesn't catch the exception unless an explicit CATCH block is added with accompanying default; the implicit CATCH misses it entirely.

@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

From @usev6

On Tue May 05 13​:41​:01 2015, raydiak@​cyberuniverses.com wrote​:

See http://irclog.perlgeek.de/perl6/2015-05-05#i_10552113

Besides the obvious problem (.clone should work there), in the process
of examining it I encountered another oddity​: trapping it with a try
block doesn't catch the exception unless an explicit CATCH block is
added with accompanying default; the implicit CATCH misses it
entirely.

It looks like there were different problems back in May, which seem to
be resolved now.

First, using .clone on an array died. This does no longer happen​:

$ perl6 -e 'my @​a = 42; @​a.clone; say "alive"'
alive

$ perl6 -e 'my @​a = 42; my @​b; try { @​b = @​a.clone }; say "alive";
@​a.push​: 44; say @​b; say @​a'
alive
[42]
[42 44]

I added two tests for this to S12-attributes/clone.t with commit
25daf16f55.

Second, using a try block didn't catch the exception. AFAIU this is
fixed and skids++ added some tests for this problem with commit
1ad644d704. Since the example with .clone no longer throws an
exception, I don't know whether additional tests are needed and how
they should look like.

Anyway, I'm closing this ticket as 'resolved'. Please reopen if you
have an idea for additional tests.

@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Oct 24, 2015
@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

@usev6 - Status changed from 'open' to 'resolved'

@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