# New Ticket Created by Darek Cidlinsky
# Please include the string: [perl #131841]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=131841 >
A minimal example:
echo 'unit module Foo; die; CATCH { }' > Foo.pm6; perl6 -I. -MFoo -e ''
That fails with a
===SORRY!===
Cannot invoke this object (REPR: Null; VMNull)
With a --ll-exception switch, it yields
Unhandled exception: concatenate requires a concrete string, but got
null
at gen/moar/stage2/NQPCORE.setting:840 (...path...)
from gen/moar/stage2/NQPHLL.nqp:1735 (...)
from src/Perl6/Compiler.nqp:42 (...)
(...)
The same happens even if we catch the exception (and probably no matter
what the CATCH block does):
echo 'unit module Foo; die; CATCH { default { .say } }' > Foo.pm6;
perl6 -I. -MFoo -e ''
And it happens no matter what the type of the exception is:
echo 'unit module Foo; X::Proc::Unsuccessful.new.throw; CATCH { default
{ .say } }' > Foo.pm6; perl6 -I. -MFoo -e ''
On the other hand, if we use 'module Foo { }' or try it in a script,
everything works OK:
perl6 -e 'die; CATCH { }'
echo 'module Foo { die; CATCH { } }' > Foo.pm6; perl6 -I. -MFoo -e ''
D.