Subject: | Unhelpful error message for invalid default arguments |
#!perl
use MooseX::Method::Signatures;
method foo($v = ) {
}
__END__
Error parsing parameter near ')' in '($v = )' at
/home/mauke/usr/lib/perl5/site_perl/5.16.1/MooseX/Method/Signatures/Meta/Method.pm
line 199.
This error message is unfortunate. It doesn't mention 1) the file
containing the error, 2) the line number with the error, or 3) the
reason why parsing failed.
Instead it's just "Error", a snippet of code, and a source location
that's completely bogus (as a user I do not care which exact part of the
parser raised the error, I want to know where in my code the problem is!).