role dependencies with 'diamond' pattern

Hi,

A hopefully quick question about dependencies which I couldn't see answered in the current docs.

Given the classic 'diamond inheritance' kind of pattern, i.e

   A requires B and C
   B requires D
   C requires D

Without parameters, does the role D get invoked once or twice? And what about if A, B C or D are invoked with (different) parameters?

I haven't had the time to create a test case so far which is mainly why I'm asking, but in any case, but it'd be nice to know: what is the intended behaviour, and is it likely to change?

Thanks,

N

Right now, d would be run twice with one instance getting variables set from b and other with variables from c, so you end up with more of a fork than a diamond.

We have discussed adding a flag for roles that would mark them as unique so the are never included/depended more than once, but that would be a 1.4 feature at the earliest.

I’d actually like to see this in 1.3 as I think it’s going to come up frequently enough.

I think “once: True” would be a sufficient syntax in the parameters.

–Michael