§2.6.(a) Externalized roles of a base team
If the base class of a role T1.R1
is again a team
T2
, roles of that team T2
can be
externalized (see §1.2.2)
using base
as their type anchor. Given that
R2
is a role of T2
, one could write:
1 |
public team class T1 { |
2 |
protected class R1 playedBy T2 { |
3 |
protected R2<@base> aRoleOfMyBase; |
4 |
} |
5 |
} |
This syntax is only legal within the body of the role T1.R1
which is bound
to the team T2
containing role R2
.
A static type prefix can be used to disambiguate a base anchor, so the explicit variant
of the above type would be R2<@R1.base>
.
It is not legal to use a type anchor containing base
as an element in a path
of references like <@base.field>
or <@field.base>
.