Skip Menu |
 

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

Report information
The Basics
Id: 39513
Status: rejected
Priority: 0/
Queue: Devel-Declare

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

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



Subject: Be aware of subroutine attributes.
Download (untitled) / with headers
text/plain 447b
Devel::Declare doesn't appear to be aware of subroutine attributes. For example... package Foo; use Method::Signatures; method echo($arg) : Something { return $arg; } This is a syntax error. Not enough arguments for Stuff::method at t/attributes.t line 14, near "method :" syntax error at t/attributes.t line 14, near "method :" I think it's just that Devel::Declare puts the "sub" keyword just before the { rather than before the :.
Subject: Re: [rt.cpan.org #39513] Be aware of subroutine attributes.
Date: Sat, 27 Sep 2008 17:47:45 +0100
To: Michael G Schwern via RT <bug-Devel-Declare [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
Download (untitled) / with headers
text/plain 1.2k
On Mon, Sep 22, 2008 at 12:54:39PM -0400, Michael G Schwern via RT wrote: Show quoted text
> Mon Sep 22 12:53:59 2008: Request 39513 was acted upon. > Transaction: Ticket created by MSCHWERN > Queue: Devel-Declare > Subject: Be aware of subroutine attributes. > Broken in: 0.002000 > Severity: Normal > Owner: Nobody > Requestors: mschwern@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39513 > > > > Devel::Declare doesn't appear to be aware of subroutine attributes. For > example... > > package Foo; > > use Method::Signatures; > > method echo($arg) : Something { > return $arg; > } > > This is a syntax error.
so is sub method (&); method : Something { ... which is how you're doing it in Method::Signatures. Show quoted text
> I think it's just that Devel::Declare puts the "sub" keyword just before > the { rather than before the :.
We don't put one in at all. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/
Download (untitled) / with headers
text/plain 154b
Devel::Declare provides you with everything you need to handle attributes. MooseX::Method::Signatures uses toke_scan_word and toke_scan_str to parse them.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.