<< §1.5.(d) Prohibition of name clashes | ↑ Table of Contents ↑ | §1.5.(f) Qualified tsuper >> |
§1.5.(e) Precedence among different supers
If a role inherits the same feature from several super roles (super and tsuper),
an implicitly inherited version always overrides any explicitly inherited feature.
Also implicit inheritance alone may produce several candidate methods inherited by a role class.
This is a result of team-nesting where each level of nesting may add one more tsuper role.
In that case inner team inheritance has precedence over outer team inheritance.
<< §1.5.(d) Prohibition of name clashes | ↑ Table of Contents ↑ | §1.5.(f) Qualified tsuper >> |
In the above example (Listing 1.5) role
OuterTeam.RoleAndTeamSub.InnerRole
has two direct tsuper roles:OuterTeam.RoleAndTeam.InnerRole
andSuperOuter.RoleAndTeamSub.InnerRole
. Without the methodfoo
defined in lines 27-30, the enclosing classOuterTeam.RoleAndTeamSub.InnerRole
would inherit the methodfoo
defined in line 16, because the inner inheritance betweenRoleAndTeamSub
andRoleAndTeam
binds stronger than the outer inheritance betweenOuterTeam
andSuperOuter
.