Skip Menu |
 

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

Report information
The Basics
Id: 45881
Status: resolved
Priority: 0/
Queue: Devel-Declare

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

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



Subject: Can't use new keyword as a method name
Download (untitled) / with headers
text/plain 585b
If you create a new keyword with Devel::Declare you can no longer call a method with the same name. The following examples croak with the error: Couldn't find declarator 'try' at /Library/Perl/5.8.8/darwin-thread-multi-2level/Devel/Declare/Context/Simple.pm line 39 (replace "try" with "method" in the second example) # Example 1 use TryCatch; sub foo { my $bar = shift; return $bar->try(); } # Example 2 use MooseX::Declare; class Foo { has "method" => (is => ro, isa => Str, default => "foobar"); method bar { print $self->method, "\n"; } } 1;


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.