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

error message with nested SORRY: BEGIN { &?ROUTINE.name } #4744

Open
p6rt opened this issue Nov 13, 2015 · 1 comment
Open

error message with nested SORRY: BEGIN { &?ROUTINE.name } #4744

p6rt opened this issue Nov 13, 2015 · 1 comment
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Nov 13, 2015

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

Searchable as RT126630$

@p6rt
Copy link
Author

p6rt commented Nov 13, 2015

From @AlexDaniel

Code​:
sub test { BEGIN { &?ROUTINE.name } }

Result​:
===SORRY!=== Error while compiling /home/alex/perl6test/./test3.pl
An exception occurred while evaluating a BEGIN
at /home/alex/perl6test/./test3.pl​:2
Exception details​:
  ===SORRY!=== Error while compiling
  Cannot call method 'name' on a null object
  at :

Whoops! It seems like it errored out while producing the error message.
That's so cool!

I don't think that someone will stumble upon this particular code ever, but
perhaps there are other times when it could break like this?

Interestingly, we can keep adding BEGIN blocks and we will be getting
different funny messages​:
sub test {
  BEGIN { BEGIN { &?ROUTINE.name; } }
}

Result​:
===SORRY!=== Error while compiling /home/alex/perl6test/./test3.pl
An exception occurred while evaluating a BEGIN
at /home/alex/perl6test/./test3.pl​:3
Exception details​:
  ===SORRY!=== Error while compiling
  ctxcode needs an MVMContext
  at :

Or even more​:
sub test {
  BEGIN { BEGIN { BEGIN { &?ROUTINE.name; } } }
}

Result​:
===SORRY!=== Error while compiling /home/alex/perl6test/./test3.pl
An exception occurred while evaluating a BEGIN
at /home/alex/perl6test/./test3.pl​:3
Exception details​:
  ===SORRY!=== Error while compiling
  ctxouter needs an MVMContext
  at :

Maybe somebody could find a way to make it more brutal? :)

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant