Skip Menu |
Report information
Id: 126630
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: LTA error message with nested SORRY: BEGIN { &?ROUTINE.name }
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Date: Fri, 13 Nov 2015 19:01:18 +0200
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
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? :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org