Skip Menu |

This queue is for tickets about the Devel-Declare CPAN distribution.

Report information
The Basics
Id: 125911
Status: new
Priority: 0/
Queue: Devel-Declare

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

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



Subject: Devel::Declare corrupts line numbering
If running attached code as perl bug.pl (you'll need A.pm too), it says Possible precedence issue with control flow operator at bug.pl line 15. even though the warning belongs to line 26
Subject: A.pm
package A; use strict; use warnings; use Devel::Declare; sub parser_sub { my ( $param, $decl, $offset) = @_; my $l = Devel::Declare::get_linestr(); substr($l, $offset + length($decl), 0) = ' ' . $param . ', sub'; Devel::Declare::set_linestr($l); } sub import { my $pkg = caller; Devel::Declare->setup_for( $pkg, { 'test' => { const => sub { parser_sub( '$param', @_ ) } } }); { no strict 'refs'; *{$pkg."::test"} = sub ($&) { }; } } 1;
Subject: bug.pl
#! /usr/bin/perl -w use strict; use warnings; use lib '.'; use A; our $param; if(1) { # bad # bad # bad # bad # bad # bad # bad # bad # bad # bad } test { }; sub foo { return can() or # <-- warning is here, actually die; } 1;
Also, this patch makes t/lines.t fail horribly: --- a/t/lines.t +++ b/t/lines.t @@ -32,6 +32,7 @@ Devel::Declare->setup_for( ); } +if (0) { sub {}->() } #line 100 fun