Role1 with attribute matches requires on Role2

[email protected] (Pedro Melo)
Newsgroups perl.moose
Message-ID <CACCxPi2tsBR18fF-Tb6wZcvAduL95RFE_TFopDqHVNz-SZkFwQ@mail.gmail.com>
Hi,

I keep getting bitten by this, and I was wondering if this is
something that will be solved eventually, or its something that would
be nice to solve but it is actually tricky to do, or just that I'm
doing it wrong.

I have two roles, R1 and R2. R1 defines a attribute ctx. R2 requires a 'ctx'.

If I use the two roles on a class C, with a single "with 'R1', 'R2';" I get

    'R1|R2' requires the method 'ctx' to be implemented by 'C'

I can work around it with two "with 'R1'; with 'R2';". But I loose all
the other protections wrt duplicate methods I might have in R1 and R2.

Opinions?
-- 
Pedro Melo
@pedromelo
http://www.simplicidade.org/
xmpp:[email protected]
mailto:[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.