Re: Overriding additional attribute options with has +$foo
[email protected] (Tomas Doran)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
On 17 Apr 2008, at 16:34, Stevan Little wrote:
> Tom,
>
> Patch looks good, I will apply it this weekend likely.
>
> As for the traits support, it should be as simple as adding
> 'traits' to the list same as you did with 'metaclass'.
I don't think that 'traits' should be supported in the same way as
metaclass however..
I think that if you have:
has foo => (
traits => [qw[SomeTrait]]
);
and in a derived package:
has '+foo' => (
traits => [qw[AnotherTrait]]
);
You should end up with:
has foo => (
traits => [qw[SomeTrait AnotherTrait]]
);
Which is what the docs / test suite in that patch is written for, but
will not (I believe) work by just adding to the list with metaclass
(instead you'd get replacement, and so have *only* AnotherTrait)..
Please correct me if I'm wrong, or if my thoughts (that we should
combine, rather than override traits) are incorrect.
Cheers
Tom