Skip Menu |

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

Report information
The Basics
Id: 87544
Status: open
Priority: 0/
Queue: Method-Signatures

People
Owner: Nobody in particular
Requestors: perl-cpan [...] bereft.net
Cc:
AdminCc:

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



Subject: M:S can corrupt line numbers for unrelated parts of the file, take 3
If a method definition occurs in a larger statement, the line-numbering can get confused: $ cat ms2.pl #!/usr/bin/perl use strict; use warnings; use Method::Signatures; my $m = method la () { die; }; warn "Line 14"; __OUTPUT__ Line 14 at ms2.pl line 12. This occurred in code that used method forms in Moose like has ... default => method { ... } In some instances, making sure there was an empty param list () seemed to fix it. The "except the original line numbering is preserved" in the docs is disappointingly not accurate in all cases. Thanks, Brad
Subject: ms2.pl
#!/usr/bin/perl use strict; use warnings; use Method::Signatures; my $m = method la () { die; }; warn "Line 14";
Subject: ms3.pl
#!/usr/bin/perl use strict; use warnings; use Method::Signatures; my $m = method la () { die; }; $line_14;
First of all, thanks for giving me a short, concise example that demonstrates the problem. I've been trying to find one of those for a while now. However, after a cursory glance, it may be the case that this is an inherited bug (from Devel::Declare). I'm going to keep digging, but that would certainly explain why I've seen this pop up in other DD-based modules (MooseX::Declare, TryCatch, etc). I'm going to keep poking at it, but it doesn't look hopeful. OTOH, maybe I could track it down even if it _is_ in DD and submit a patch there. That's trickier, but I'll see what I can do. Certainly it annoys me too when it happens. :-) Thanx for the bug report.
On Fri Aug 02 20:52:29 2013, BAREFOOT wrote: Show quoted text
> First of all, thanks for giving me a short, concise example that > demonstrates the problem. I've been trying to find one of those for a > while now.
For completeness, attached is my ms1.pl test, which is probably the same as #81361 Show quoted text
> OTOH, maybe I could track it down even if it _is_ in DD and submit a > patch there. That's trickier, but I'll see what I can do. Certainly > it annoys me too when it happens. :-)
Good luck. That's deep magic...
Subject: ms1.pl
#!/usr/bin/perl use strict; use warnings; use Method::Signatures; method la ($this, $that ) { die; } warn "Line 14";
On Fri Aug 02 20:52:29 2013, BAREFOOT wrote: Show quoted text
> However, after a cursory glance, it may be the case that this is an > inherited bug (from Devel::Declare). I'm going to keep digging, but > that would certainly explain why I've seen this pop up in other DD- > based modules (MooseX::Declare, TryCatch, etc). I'm going to keep > poking at it, but it doesn't look hopeful. > > OTOH, maybe I could track it down even if it _is_ in DD and submit a > patch there. That's trickier, but I'll see what I can do. Certainly > it annoys me too when it happens. :-)
FWIW, a colleague tried the examples with the non-Devel::Declare based Function::Parameters and the line numbers were correct. It uses the PL_keyword_plugin from perlapi instead of DD. Brad