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/Attribute.pm
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/Attribute.pm
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 |
Message body not shown because it is not plain text.