| << §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.InnerRolehas two direct tsuper roles:OuterTeam.RoleAndTeam.InnerRoleandSuperOuter.RoleAndTeamSub.InnerRole. Without the methodfoodefined in lines 27-30, the enclosing classOuterTeam.RoleAndTeamSub.InnerRolewould inherit the methodfoodefined in line 16, because the inner inheritance betweenRoleAndTeamSubandRoleAndTeambinds stronger than the outer inheritance betweenOuterTeamandSuperOuter.