Subject: | Newline between method and { causes strange behavior |
Date: | Sat, 4 Dec 2010 13:59:05 -0600 |
To: | bug-MooseX-Method-Signatures [...] rt.cpan.org |
From: | Joe Zbiciak <j-zbiciak1 [...] ti.com> |
Hello,
In the attached example, if I put my opening curly brace for a 'method'
on the same line as 'method' itself, everything works as expected.
If I move the curly brace to the next line, it fails.
What ends up happening is that MooseX::Method::Signatures appeares to
pick up the signature for the *next* method, not the current method.
Also, the last method in the package goes totally missing.
The example 'signature_bug.pl' shows the misapplied method signatures.
It results in the following output:
$ ./signature_bug.pl
Not busted:
one_arg(not busted)
Busted:
Validation failed for 'Tuple[Tuple[Object,Any,Any],Dict[]]' with value [ [ busted=HASH(0x8f7152c), "busted" ], { } ], Internal Validation Error is:
[+] Validation failed for 'Tuple[Object,Any,Any]' with value [ busted{ }, "busted" ]
[+] Validation failed for 'Any' with value NULL at /db/perf/lib/perl5/site_perl/5.12.2/MooseX/Method/Signatures/Meta/Method.pm line 435
MooseX::Method::Signatures::Meta::Method::validate('MooseX::Method::Signatures::Meta::Method=HASH(0x8f71c34)', 'ARRAY(0x8f71928)') called at /db/perf/lib/perl5/site_perl/5.12.2/MooseX/Method/Signatures/Meta/Method.pm line 151
busted::one_arg('busted=HASH(0x8f7152c)', 'busted') called at ./signature_bug.pl line 14
The example 'signature_bug2.pl' shows how the final method in the
module goes AWOL. It outputs the following:
$ ./signature_bug2.pl
Not busted:
two_args(not, busted)
Busted:
Can't locate object method "two_args" via package "busted" at ./signature_bug2.pl line 14.
Module version information:
Perl 5.12.2
Moose 1.21
MooseX::Method::Signatures 0.36
Devel::Declare 0.006000
This is a fresh installation of Perl, Moose, etc. brought up to date
with CPAN as of yesterday (03-Dec-2010).
Regards,
--Joe Zbiciak
--
: Joseph Zbiciak, SMTS : Discovery consists of seeing
: j-zbiciak1@ti.com : what everybody has seen and
: #include <std_disc.h> : thinking what nobody has thought.
: Texas Instruments : --Albert Szent-Gyorgyi
Message body not shown because it is not plain text.