§1.5.(f) Qualified tsuper

A role in a nested team may qualify the keyword tsuper (see §1.3.1.(f) above) by a type name in order to select among different implicit super classes. A term OuterTeam.tsuper evaluates to a corresponding implicit super class within the context of the explicit super-class (here: SuperOuter) of the enclosing team "OuterTeam". A method call OuterTeam.tsuper.m() evaluates to the method version within SuperOuter that best corresponds to the current method containing the tsuper-call.

  • In the above example (Listing 1.5) line 28 selects the method version within the superclass of RoleAndTeamSub (i.e., within RoleAndTeam), resolving to OuterTeam.RoleAndTeam.InnerRole.foo().
  • Line 29 selects a corresponding method from the context of SuperOuter resolving to SuperOuter.RoleAndTeamSub.InnerRole.foo() which has the same semantics as an unqualified tsuper call would have.