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

Strange error message in rakudo when returning from outside of a sub #183

Closed
p6rt opened this issue Jul 25, 2008 · 10 comments
Closed

Strange error message in rakudo when returning from outside of a sub #183

p6rt opened this issue Jul 25, 2008 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Jul 25, 2008

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

Searchable as RT57268$

@p6rt
Copy link
Author

p6rt commented Jul 25, 2008

From @masak

$ svn info | grep Revi
Revision​: 29734
$ ./perl6 -e 'return'
No exception handler and no message

This error message is strange, needlessly exposes internals, and
doesn't say where the error occurred. It could be more like Perl 5's
error message​:

$ perl -e 'return'
Can't return outside a subroutine at -e line 1.

@p6rt
Copy link
Author

p6rt commented Jul 26, 2008

From @pmichaud

On Fri, Jul 25, 2008 at 05​:47​:30AM -0700, Carl Mäsak wrote​:

$ svn info | grep Revi
Revision​: 29734
$ ./perl6 -e 'return'
No exception handler and no message

This error message is strange, needlessly exposes internals, and
doesn't say where the error occurred. It could be more like Perl 5's
error message​:

$ perl -e 'return'
Can't return outside a subroutine at -e line 1.

Getting rakudo to do "Can't return outside a subroutine" is probably
not too difficult, reporting the line number needs some work
(see RT #​53082 and #​43269).

I suspect that PCT will end up implementing a setfile/setline
workaround, and that really should happen as part of the PGE
refactor (so we can efficiently compute line numbers to be
stored in the generated code).

Pm

@p6rt
Copy link
Author

p6rt commented Jul 26, 2008

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

@p6rt
Copy link
Author

p6rt commented May 15, 2009

From @jnthn

On Fri Jul 25 05​:47​:30 2008, masak wrote​:

$ svn info | grep Revi
Revision​: 29734
$ ./perl6 -e 'return'
No exception handler and no message

This error message is strange, needlessly exposes internals, and
doesn't say where the error occurred. It could be more like Perl 5's
error message​:

$ perl -e 'return'
Can't return outside a subroutine at -e line 1.

Rakudo now says​:

$ perl6 -e "return"
Can't return outside a routine
in Main (<unknown>​:1)

(Generalized subroutine to routine, since we also have method and
submethod in Perl 6.)

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented May 15, 2009

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

@p6rt
Copy link
Author

p6rt commented Apr 29, 2010

From @masak

On Fri May 15 11​:42​:46 2009, jnthn@​jnthn.net wrote​:

On Fri Jul 25 05​:47​:30 2008, masak wrote​:

$ svn info | grep Revi
Revision​: 29734
$ ./perl6 -e 'return'
No exception handler and no message

This error message is strange, needlessly exposes internals, and
doesn't say where the error occurred. It could be more like Perl 5's
error message​:

$ perl -e 'return'
Can't return outside a subroutine at -e line 1.

Rakudo now says​:

$ perl6 -e "return"
Can't return outside a routine
in Main (<unknown>​:1)

(Generalized subroutine to routine, since we also have method and
submethod in Perl 6.)

We're back to the bad error message​:

$ perl6 -e 'return'
No exception handler and no message

Reopening ticket.

@p6rt
Copy link
Author

p6rt commented Apr 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Dec 10, 2010

From @thundergnat

Seems to be working correctly in rakudo 2010.11.

This is Rakudo Perl 6, version 2010.11 built on parrot 2.10.1
RELEASE_2_10_1-679-g9bec614

Locally, executing​:

perl6 -e "return"

simply returns with no message.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

From @moritz

Now says​:
Attempt to return outside of any Routine

which seems pretty good to me.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

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

@p6rt p6rt closed this as completed Sep 30, 2011
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