Skip Menu |

This queue is for tickets about the Method-Signatures-Simple CPAN distribution.

Report information
The Basics
Id: 80507
Status: resolved
Priority: 0/
Queue: Method-Signatures-Simple

People
Owner: Nobody in particular
Requestors: MAUKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.02
Fixed in: (no value)



Subject: M:S:S can corrupt line numbers for unrelated parts of the file
$ cat bug/lineno #!perl use Method::Signatures::Simple; func id_2 ( $x ) { $x } die; # line 10 __END__ $ perl bug/lineno Died at bug/lineno line 8. The line numbers reported by perl are wrong. I have a second program showing the same symptoms; the causes may be unrelated, though, so I'm including it: $ cat bug/lineno2 #!perl use warnings; use strict; use Method::Signatures::Simple; { my $uniq = 0; method fresh_name() { $self->prefix . $uniq++ } } # line 13 method prefix() { $self->{prefix} } my $aref = []; my $oops = %{ $aref }; # line 20 print "got $oops\n"; __END__ $ perl bug/lineno2 Not a HASH reference at bug/lineno2 line 13.
On Tue Oct 30 18:47:26 2012, MAUKE wrote: Show quoted text
> $ cat bug/lineno > #!perl > use Method::Signatures::Simple; > func id_2 > ( > $x > ) > { > $x > } > die; # line 10 > __END__ > $ perl bug/lineno > Died at bug/lineno line 8. > > The line numbers reported by perl are wrong.
I have a fix for this particular one. I don't know how to fix your second program though. It looks like Devel::Declare does weird stuff due to that scope change. If you comment out the braces for that anonymous block, it'll now report the correct line number (as of 1.04). I added a TODO test in case I ever get an epiphany. rhesa I have a second program Show quoted text
> showing the same symptoms; the causes may be unrelated, though, so I'm > including it: > $ cat bug/lineno2 > #!perl > use warnings; > use strict; > > use Method::Signatures::Simple; > > { > my $uniq = 0; > > method fresh_name() { > $self->prefix . $uniq++ > } > } # line 13 > > method prefix() { > $self->{prefix} > } > > my $aref = []; > my $oops = %{ $aref }; # line 20 > > print "got $oops\n"; > > __END__ > $ perl bug/lineno2 > Not a HASH reference at bug/lineno2 line 13.