Skip Menu |

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

Report information
The Basics
Id: 58908
Status: new
Priority: 0/
Queue: MooseX-Declare

Owner: Nobody in particular
Requestors: mschwern [...]

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

Subject: trigger does not accept a method
This DWIM: class Baz { has foo => isa => "Str", is => "rw", default => method { print "default!" }; } This blows up: class Baz { has bar => isa => "Str", is => "rw", trigger => method { print "trigger!" }; } Trigger must be a CODE ref on attribute (bar) at /usr/local/perl/5.10.1/lib/site_perl/5.10.1/darwin-thread-multi-64int-ld-2level/Moose/Meta/ line 52 Moose::Meta::Attribute::new('Moose::Meta::Attribute', 'bar', 'trigger', 'MooseX::Method::Signatures::Meta::Method=HASH(0xcfa6e8)', 'isa', 'Str', 'definition_context', 'HASH(0xd03d34)', 'is', 'rw') called at /usr/local/perl/5.10.1/lib/site_perl/5.10.1/darwin-thread-multi-64int-ld-2level/Moose/Meta/ line 78 I'm kind of surprised method doesn't return an anonymous code ref. Knowing that, I'm kind of surprised it works with default. Perhaps magic was added for default and not for trigger? Whatever it is, could that magic be sprinkled onto trigger and whatever else takes a code ref? Thanks.
Subject: test.plx
Download test.plx
application/octet-stream 265b

Message body not shown because it is not plain text.

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

Please report any issues with to