Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

role stub workaround fails for parameterized roles

1 view
Skip to first unread message

John Macdonald

unread,
Apr 11, 2018, 12:00:02 AM4/11/18
to mo...@perl.org

There is a problem described for roles, where an attribute defined by one role is used in another.  The workaround given is to have the parent define a stub method with "sub METHOD {}"


This doesn't work for MooseX::Role::Parameterized roles.  In this case, even

with the stub declred, there is still the error:  Attribute (ATTR) of class CLASS has no associated methods (did you mean to provide an "is" argument?)


I presume that this is related to the requirement in parameterized roles that method cannot be declare as sub's but must be declared using the "method" keyword.


Is there a way to declare a stub  method for parameterized roles?


John Macdonald
Software Engineer

Ontario Institute for Cancer Research
MaRS Centre

661 University Avenue

Suite 510
Toronto, Ontario

Canada M5G 0A3

Tel:

Email: John.Ma...@oicr.on.ca

Toll-free: 1-866-678-6427
Twitter: @OICR_news


www.oicr.on.ca

This message and any attachments may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this message in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this message may not be that of the organization.

Ricardo Signes

unread,
Apr 11, 2018, 6:00:02 PM4/11/18
to John Macdonald, mo...@perl.org
* John Macdonald <John.Ma...@oicr.on.ca> [2018-04-09T15:05:02]
> Is there a way to declare a stub method for parameterized roles?

I think so. I feel like I've probably solved this, as I use parameterized
roles often.

Could you show us some *simple-as-possible* failing code, and I'll try to get
it passing for you? :)

--
rjbs
signature.asc
0 new messages