[perl #127977] [BUG] Constraint on a slurpy MAIN parameter leaks out internal exceptions

2016-04-29 Thread Christian Bartolomaeus via RT
For the records: There is a test for this ticket (currently fudged 'todo') in 
S06-other/main-usage.t


[perl #127977] [BUG] Constraint on a slurpy MAIN parameter leaks out internal exceptions

2016-04-24 Thread via RT
# New Ticket Created by  Tadeusz SoĊ›nierz 
# Please include the string:  [perl #127977]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127977 >


$ cat test.pl
sub MAIN(@args where sub { False }) {
 say ":)"
}

$ perl6 test.pl
Usage:
   test.pl 



$ cat test.pl # note the slurpy
sub MAIN(*@args where sub { False }) {
 say ":)"
}

$ perl6 test.pl
Constraint type check failed for parameter '@args'
   in sub MAIN at test.pl line 1
   in block  at test.pl line 1

--

I expect USAGE in both cases, since it's both exactly invalid use of MAIN.
Patch and spectest incoming.