| ↑ Table of Contents ↑ | §4.9.2 Role side inheritance >> |
§4.9.1 Base side inheritance
Generally, a callin binding affects all sub-types of its bound base.
Specifically, if a role type R bound to a base type B
defines a callin binding rm <- callin_modifier bm,
the following rules apply:
(a) Effect on sub-classes
The callin binding also effects instances of any type BSub
that is a sub-type of B.
If BSub overrides the bound base method bm,
the overridden version is generally affected, too.
However, if bm covariantly redefines the return type from its
super version, the callin binding has to explicitly specify if the covariant
sub-class version should be affected, too (see §4.9.3.(b)).
(b) No effect on super-classes
The binding never affects an instance of any super-type of B
even if the method bm is inherited from a super-class
or overrides an inherited method.
This ensures that dispatching to a role method due to a callin binding
always provides a base instance that has at least the type declared in the role's
playedBy clause.
For corresponding definitions regarding static methods see §4.7.(e).
| ↑ Table of Contents ↑ | §4.9.2 Role side inheritance >> |